Quantcast
Channel: In ASP.NET, when should I use Session.Clear() rather than Session.Abandon()? - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by MatthewMartin for In ASP.NET, when should I use Session.Clear() rather than Session.Abandon()?

$
0
0

I had this issue and tried both, but had to settle for removing crap like "pageEditState", but not removing user info lest I have to look it up again.

public static void RemoveEverythingButUserInfo(){    foreach (String o in HttpContext.Current.Session.Keys)    {        if (o != "UserInfoIDontWantToAskForAgain")            keys.Add(o);    }}

Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>