Reputation: 85056
What does asp.net do in the background when a session expires? Is the session completely disposed of, or do I need to add something like Session.Abandon();
in my Session_End
event in Global.asax?
Upvotes: 0
Views: 507
Reputation: 100547
In-memory state - the object is removed from list of sessions and Session_End
is called. For SQL session state nothing happens and data will no longer be returned for future requests with the same session ID since it does not match (ID + non-expired) condition.
You don't need to call Session.Abandon()
in Session_End
because that event called when session is expired (which is exactly what Abandon
does).
Notes
Session_End
event because out-ouf-process state does not fire it. Upvotes: 3
Reputation: 304
Session will get cleared if you were using inproc session provider so you won't need to call Session.Abandon()
.
Upvotes: 1
Reputation: 17480
The session is completely disposed. You don't need to do anything special. Session_End
is an event that allows you to do things upon session disposal.
Session.Abandon()
is a command that lets you terminate a session at will.
Note: If you don't put any variable in the Session
, then Session_End
will not fire.
Upvotes: 1