If you want to remove session on application lavel than use Session.Abandon() and if you want to remove single or particular session id than use
Session.Remove("XYZ")
put Session.Abandon() or Session.Remove("XYZ") logout click event.
Thanks,
Jeet Patel
Remember to click “Mark as Answer” on the post, if it helps you.
It's not going to get called when you close the browser. How does the server know you closed the browser? Your browser isn't conneted directly to the server during the entire time. It is only connected while it is getting the html, images, css, etc.. Once
it's done the connection is closed. That's why you have a Session object, because the web is stateless and the clients are not connected in a true session. The session will continue regardless of your browser until IIS determines that the session has reached
the timeout, the application hasn't been used during a certain period of time, or the application pool crashes or is recycled.
StatemanagementSession
Don't forget to mark useful responses as Answer if they helped you towards a solution.
Member
60 Points
80 Posts
How to call Session_End method??
Sep 13, 2011 04:22 AM|smilu.net|LINK
I have an application Im using Session to store the Login and Logout info...
but my Seesion_End event is not getting raised.
If I stop the server at that time it will end all the sessions i started..
I set the Sesssionstate as InProc in Web.Config tooo..
But still its not working when i close the browser..
When I close the browser how can i call it?? or am i missing any thing?
Statemanagement Session
Participant
771 Points
158 Posts
Re: How to call Session_End method??
Sep 13, 2011 04:38 AM|harsh.cer|LINK
hi friend,
Following link will help you
http://forums.asp.net/t/1116238.aspx
http://weblogs.asp.net/kodali/archive/2010/04/29/asp-net-session-on-browser-close.aspx
http://www.daniweb.com/web-development/aspnet/threads/39287
Statemanagement Session
Harshal D.
Software Engineer
Remember to click “Mark as Answer” on the post If you get answer from my post(s) !
Member
241 Points
74 Posts
Re: How to call Session_End method??
Sep 13, 2011 04:56 AM|jeet.patel|LINK
Hi,
If you want to remove session on application lavel than use Session.Abandon() and if you want to remove single or particular session id than use Session.Remove("XYZ")
put Session.Abandon() or Session.Remove("XYZ") logout click event.
Jeet Patel
Remember to click “Mark as Answer” on the post, if it helps you.
Contributor
3773 Points
1206 Posts
Re: How to call Session_End method??
Sep 14, 2011 03:01 PM|konanki|LINK
example for session_end
http://www.codeproject.com/KB/aspnet/SessionEndStatePersister.aspx
killng session u have to use session.abandon();session.clear();
All-Star
25756 Points
7014 Posts
Re: How to call Session_End method??
Sep 14, 2011 03:28 PM|hans_v|LINK
It is not supposed to! The session end automatically after the amount of minutes (default 20) of inacticity set in the TimeOut property
http://msdn.microsoft.com/en-us/library/ms178581.aspx
All-Star
26071 Points
5892 Posts
Re: How to call Session_End method??
Sep 14, 2011 04:54 PM|markfitzme|LINK
It's not going to get called when you close the browser. How does the server know you closed the browser? Your browser isn't conneted directly to the server during the entire time. It is only connected while it is getting the html, images, css, etc.. Once it's done the connection is closed. That's why you have a Session object, because the web is stateless and the clients are not connected in a true session. The session will continue regardless of your browser until IIS determines that the session has reached the timeout, the application hasn't been used during a certain period of time, or the application pool crashes or is recycled.
Statemanagement Session