Reputation: 1077
I have code which stores user details in HttpContext.Current.Session
for auditing purposes.
I'm wanting to test exception handling for when the session expires, is there a way of clearing the session variables in HttpContext.Current.Session
from Internet explorer developer toolbar so that I don't have to wait for it to expire?
thanks
Upvotes: 0
Views: 1825
Reputation: 1509
Try Clearing Cookies. that should clear your ASP Session Cookies as well and your server wont recognise that the request is coming from the same session.
Upvotes: 1
Reputation: 35564
You can use
Session.Remove(SessionName);
//or
Session.RemoveAll();
//or
Session.Clear();
//or
Session.Abandon();
More info here for details on the differences: https://msdn.microsoft.com/en-us/library/ms524319(v=vs.90).aspx
Upvotes: 0