Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SessionState Timeout

Tags:

c#

asp.net

I have this setting in the web.config file: <sessionState timeout="540" />. This tries to make all the sessions expires after 8 hours. However, the session expires much faster than that and I got an object reference not set to an instance of an object error. Could some tell me if there is something else affects the session?

Thanks in advance!

like image 987
Niventh Avatar asked Feb 18 '23 08:02

Niventh


1 Answers

SessionState expires also if the application pool recycles (inactivity, exception, or configuration).

Anyway, it is not a best practice to extend the SessionState timeout so much.

maybe you should change you dependency to session or use a different way to persist those objects (viewstate).

If you absolutely need to have session to persist so much you should use another server or a db as session store.

http://msdn.microsoft.com/en-us/library/ms178586(v=vs.100).aspx

like image 85
giammin Avatar answered Feb 23 '23 18:02

giammin