开发者

Remove HttpContext.Current.Session

开发者 https://www.devze.com 2023-03-25 10:16 出处:网络
I have an appli开发者_JS百科cation which stores session variables. When I do the logout I call the RemoveAll() method on available sessions.

I have an appli开发者_JS百科cation which stores session variables. When I do the logout I call the RemoveAll() method on available sessions.

The method seems not working. Do you know how it is possible to force removing a Session variable?

Regards.


Session.Abandon()

cancels the current session

Session.Clear() 

will just clear the session data and the the session will remain alive

more Details:

Session.Abandon() method destroys all the objects stored in a Session object and releases their resources. If you do not call the Abandon method explicitly, the server destroys these objects when the session times out(I may add:Session_OnEnd event is triggered)

http://msdn.microsoft.com/en-us/library/ms524310.aspx

Session.Clear() just removes all values (content) from the Object. The session with the same key is still alive.

0

精彩评论

暂无评论...
验证码 换一张
取 消