Is there a way to access session variables in global.asax? I have a timer function set in Application_Start(), but for which I'm in need to access my user credentials which I stored after login. But I can't seem to access the session storage here. Any idea why I can't or any other way to store and access user data in global.asax would be helpful.
Asked
Active
Viewed 50 times
1 Answers
0
I assume that you use the Identity Framework. You can read here how to access Session Data: https://stackoverflow.com/a/1164629 This is how you can just access the Database via the ApplicationDbContext:
var UsersContext = new ApplicationDbContext();
List<ApplicationUser> = UsersContext.Users.toList()