0

When I debug I can see that storing data in my session works, the below code serializes an array and fills Session["RBACParts"]:

var serialisedData = JsonConvert.SerializeObject(rbac.Parts);
HttpContext.Current.Session["RBACParts"] = serialisedData;

But when I try to get the parts again in a different call Session["RBACParts"] doesn't exist in the session anymore:

var serialisedData = HttpContext.Current.Session["RBACParts"] as string;

It only doesn't work for me locally; on my colleagues' station it works fine and in the test environment it also works. Where should I look to find out why this doesn't work?

I'm using Visual Studio Enterprise 2017. I run my API project using IIS Express (Google Chrome). I don't get any error messages, only through debugging I found out that while setting the session data works, when I try to get the data it doesn't work anymore.

EDIT:

It works in Internet Explore 11, but not in Chrome

Friso
  • 2,328
  • 9
  • 36
  • 72
  • This may be the laziest answer ever, and I apologize if this sounds patronizing, but have you tried rebooting your machine? – Doug F Dec 05 '18 at 13:20
  • @dougF I rebooted my machine, reinstalled chrome and deleted my project and downloaded it again – Friso Dec 05 '18 at 13:21
  • And when you said it worked on your colleagues' machine, was your colleague debugging it, same as you have been? I'm just trying to make sure your colleague wasn't getting a false positive. – Doug F Dec 05 '18 at 13:27
  • @dougF they were doing the same thing as me, in the same develop branch – Friso Dec 05 '18 at 13:29
  • Session is not a database. Make sure you don’t store irrelevant things there. – Lex Li Dec 05 '18 at 16:35
  • Could be that your IIS Express user profile for the specific application registration got corrupted somehow? You could try to clean up this IIS Express user profile. Refer to https://stackoverflow.com/questions/12946476/where-is-the-iis-express-configuration-metabase-file-found – Carl in 't Veld Dec 06 '18 at 14:26

0 Answers0