Session variable losing value

N

Nate Spillson

I have an asp.net web application that uses session variables to store
user information (username, security areas, configuration data). When
the user logs into the system I store all of this information in a
class and then dump it into a session variable. The timeout on the
server is set to 2hrs. Every now and then (5min-30min) the web server
will lose the session variable. This is very inconsistent and doesn't
appear to have an associated pattern. Has anyone else come across this
issue and determined the root cause?
I've found a lot of posts that describe this issue but none that
actually pinpoint the cause or solution.

Please don't recommend that I use cookies, some other solution or
question why I'm storing this information in a session variable. The
application is structured in this way to meet specific user/regulatory
requirements and user imposed constraints.

Thanks!
Nate
 
R

Rao TRN

Are you sure that the user keeps interacting with your web site for 2 hrs
after he logs in? Typically, I guess you maintain one session class object
per user and populates this class once the user logs in. Once the user
terminates his session (by logging out and closing the browser), it is lost.
That is how a session is defined logically.
 
M

Marina

It really depends on what you mean by "logging out and closing the browser".
If there is code to call Session.Abandon() in the sign out code, then yes,
this ends the session. But you don't know if there is.

Simply closing the browser does not end the session. The session continues
until the timeout.

However, any new browser instances will create a new session - while the
original one is still alive until the timeout occurrs.


Things that can occur an applications restart:
1) chaging DLL's, web.config, etc on the server
2) certain antivirus scanners that scan the above files, thus triggering a
restart
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top