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

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

$
0
0

Both Session.Clear() and Session.Abandon() get rid of session variables. As I understand it, Abandon() ends the current session, and causes a new session to be created thus causing the End and Start events to fire.

It seems preferable to call Abandon() in most cases, such as logging a user out. Are there scenarios where I'd use Clear() instead? Is there much of a performance difference?


Viewing all articles
Browse latest Browse all 5

Trending Articles