Last post Oct 24, 2013 11:26 AM by Rion Williams
Oct 24, 2013 06:48 AM|shubham.mvp|LINK
Even after using:
I am unable to kill session.
This issues has been confirmed using Fiddler tool. Is there other way to kill session forcefully.
Oct 24, 2013 06:59 AM|er_abhi|LINK
Also try using Session.Clear();
Oct 24, 2013 09:06 AM|Ashim Chatterjee|LINK
the code you shared is perfect brother ...however you can try clearing the cache memory also ...
paste this piece of code after clearing the sessions by session.abandon() etc etc..
Oct 24, 2013 11:15 AM|aarsh|LINK
If you want to do this manually, try this :
Task Manager --> Processes Tab --> "Show processes from all users" --> kill w3wp.exe ( this is IIS worker process )
Oct 24, 2013 11:26 AM|Rion Williams|LINK
To immediately remove all of the values from the Session, you can use the
Session.Clear() method :
//This will immediately remove all of the values from the Session
However, it should be noted that this will not completely "kill" the Session. To completely remove the Session entirely you need to use the Session.Abandon() method, which will remove the Session entirely AFTER the current Request has finished :
//This will destroy the Session AFTER the current request has completed
It's very important to realize that the Abandon method does not take place until after the current Request has finished. I have seen it used in the past in situations like the following one and it can cause a bit of confusion :
//Schedule to abandon the Session
//Access a Session variable here
var example = Session["Example"];