.

Clearing sessions in .Net

/// 
/// The session has to be reset in this fashion. This is the way to prevent 
/// an attacker to steal session, etc. (At least make it harder to)
/// 
public static void ResetWebSession()
{
 // Abandon the current session
 HttpContext.Current.Session.Abandon();

 // Reset the sessionID in the cookies
 HttpContext.Current.Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", ""));
}

What's your thoughts on this?

*

Protected by WP Anti Spam