How to create a LOGOUT Page using Sessions
at
12:00 PM
Labels:
Aspnet,
Authentication,
C#,
CSharp,
Custom Controls,
Sessions,
Tanisha
Hi Friends I am already explained in my previous post how to create Login Page in asp net Click Here.
Now i am going to explain you how to create a Logout Page
First open the Microsoft visual studio 2008
Next, add one Web Form and change the name as Logout.aspx
Next, open the code page that is Logout.aspx.cs
And write the following code in the page load
protected void Page_Load(object sender, EventArgs e)
{
Session.Abandon();
Session.Remove("Username");
FormsAuthentication.SignOut();
// Response.Redirect(Request.UrlReferrer.ToString());
Response.Redirect("Logout.aspx");
}
That’s it. If you have any queries please let me know.i am always ready to share my knowledge with you..
Now i am going to explain you how to create a Logout Page
First open the Microsoft visual studio 2008
Next, add one Web Form and change the name as Logout.aspx
Next, open the code page that is Logout.aspx.cs
And write the following code in the page load
protected void Page_Load(object sender, EventArgs e)
{
Session.Abandon();
Session.Remove("Username");
FormsAuthentication.SignOut();
// Response.Redirect(Request.UrlReferrer.ToString());
Response.Redirect("Logout.aspx");
}
That’s it. If you have any queries please let me know.i am always ready to share my knowledge with you..












