What factor determine a session to end?

  • Thread starter Thread starter Kian Goh
  • Start date Start date
K

Kian Goh

Hi there,

Just wonder what factor actually determine a session to end?

What happen a user close the browser or switch to other website? Does the
session end immediately or 20 minutes later? (20 minutes defined in
Web.config)

Thanks,
Kian
 
The session will time out after 20 minutes of no page requests from the
user.
This default time interval is configurable in your web.config file.
After the session times out the Session_End event will be called in your
Global.asax file.
You can terminate the session manually by calling Session.Abandon, but be
aware this will cause the Session_End event to not be called. But that's
not so bad. Just take your code from the Session_End event, put it in a
separate function, then call that function from both your Session_End event
and whenever you call Session.Abandon.

Here's more details for you:
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=7504
 
Back
Top