Global.asax Session_End

  • Thread starter Thread starter GregoryJ
  • Start date Start date
G

GregoryJ

I'm trying to get my Session_End event to fire when my web application has
lost focus or the web browser has been closed. From what I saw on a internet
site it stated to set the following

<sessionState
mode="InProc">
</sessionState>

Should having this set should make the Session_End event fire?

I need to fire an event when the user either leaves my site or closes the
browser so that if they return they have to login again. My Session_Start
event fires, but not my Session_End.

What must I do to make this fire when closing the browser?

Thanks.
 
Thanks for giving me this oversight even though I am in the wrong newsgroup.
What you say makes sense.

Basically, I am evaluating the Session's state when I load my pages using a
Cookie that holds some session related information.

Although I'm in the wrong place, can I ask one question about the
Cookie.Expires method. If I set the Cookie to expire in 20 minutes, what
would be the best approach to keeping the session from expiring while someone
is working in the application. My thought is that I'm going to reset the
Expire minutes everytime a new page or transaction takes place. Good idea or
bad?

Thanks again for your insight and time.
 
GregoryJ said:
Thanks for giving me this oversight even though I am in the wrong newsgroup.
What you say makes sense.

Basically, I am evaluating the Session's state when I load my pages using a
Cookie that holds some session related information.

Although I'm in the wrong place, can I ask one question about the
Cookie.Expires method. If I set the Cookie to expire in 20 minutes,

Cookies with such a short expiration date doesn't work well. If the user
is in a different time zone, the cookie will either last for hours or
expire immediately.
what
would be the best approach to keeping the session from expiring while someone
is working in the application. My thought is that I'm going to reset the
Expire minutes everytime a new page or transaction takes place. Good idea or
bad?

Bad idea. Don't use the cookie expiration to keep track of the session
timeout. Store the last request time in the cookie and set the
expiration date to at least a day from now.
 
Back
Top