Click here to Skip to main content
14,882,317 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
void Session_End(object sender, EventArgs e)
{

}


how this works, when my idle time for logout is 20minute

Guys, i need a javascript code for my asp.net project,
1) on browser close current session expire(logout).
2)but not logout in postback , button click, hyperlink.
3)and automatic logout when session idle time exceed 20 minute
4)code support atleast 3 browsers google chrome, firefox, IE, b'coz my code not support in firefox.

plz help me
Posted
Updated 2-Oct-13 4:36am
v3

1 solution

Your web application starts as soon as the first visitor hits your page. For each different user, a session will be created. A session has a certain expiration. If the user stops browsing your website, the session expires after expirationTime of the last hit on your server. (expirationTime has a default of 20 minutes)

Each time a session expires, the method above will be executed.
After the last session expires, also Application_End() will be executed.

You cannot call the method manually to expire sessions when you want.

Eduard
   
Comments
arvind bisht 2-Oct-13 10:32am
   
how to handle logout function on browser close and which do not logout on autopostback.


plz sir help me
Eduard Keilholz 2-Oct-13 10:50am
   
You can't
arvind bisht 2-Oct-13 10:35am
   
Hi Guys, i need a javascript code for my asp.net project,
1) on browser close current session expire(logout).
2)but not logout in postback , button click, hyperlink.
3)and automatic logout when session idle time exceed 20 minute
4)code support atleast 3 browsers google chrome, firefox, IE, b'coz my code not support in firefox.

plz help me

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900