Web browsers seem to have a reliable inbuilt mechanism such that after 20min of browser inactivity, the session variable becomes blank. How can i catch that moment before the user's session variable becomes blank? I would like to trigger an event to fire either becomes blank or just after its blank. Thank you! MICAH
Reply from Richard Rost:
Session variables are actually stored on the SERVER, not in the browser. If the server doesn't see activity from you in 20 minutes it clears your variables to save memory. If this is YOUR site, you can prevent that from happening with an inline frame that automatically refreshes every 5, 10, or 15 minutes to keep the user's session alive on the server. I do this on my site. If you look closely at the bottom of my site, there's an inline frame where the copyright notice is. That keeps people from getting logged out of the Online Theater when they're watching classes (watch a 15 minute lesson, go get coffee, and you get logged out because the server hasn't seen you in over 20 minutes - the video itself is playing from your browser cache after it downloads). Note that you can increase this timeout in your ASP code with the Session.Timeout property, but if you have a lot of concurrent users, this can cause your server to run out of memory.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Active Server Pages Forum.