Destroying Session

shahab

Junior Contributor
Joined
Aug 14, 2003
Messages
206
Location
Iran(Middle East)
I have a session how can I destroy it:
Session["username"] = TextBox1.Text.ToString();


if (isUserValid(TextBox1.Text.ToString(),TextBox2.Text.ToString()))
{
TextBox1.Text="";
Response.Redirect("AdminUsers/Main.aspx");

}
else
{
Session.Remove("username");
//Session.Abandon();
What is the differene between clear-Abandon-...?
 
Session.Remove removes the item from the particular user's session, session.abandon terminates the session for the user, so anypage requested after will generate a new session id for the user.
 
Back
Top