Reputation: 995
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!
Upvotes: 4
Views: 12509
Reputation: 18968
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
Upvotes: 8