when i click signout from userhome.aspx it will redirected to loginpage. if i copy the the address box string like
http://localhost:1446/t%20work/hdesk/UserHome.aspx
it will again redirects to userhome.aspx without propting username and password even thouigh i cleared sesssion.
please help me to overcome from this problem.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Purushottam RathoreRank #120 · 18.2K reputationPosted Dec 30, 2009, 8:27 PM EST
Purushottam RathoreRank #120 · 18.2K reputationPosted Dec 30, 2009, 8:27 PM EST
Follow this link
http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=73273
Raunak Jhawar51 reputationPosted Dec 30, 2009, 9:28 PM EST
//Code for Log out button
protected void Logout_Click(object sender, EventArgs e)
{
Session.Clear();
Session.Abandon();
Response.Redirect("Login.aspx");
}
//Code for page Load
protected void Page_Load(object sender, EventArgs e)
{
if (Session["UserID"] == null)
{
Response.Redirect("Login.aspx");
}
else
{
Label6.Text = Session["UserID"].ToString();
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d);
Response.Expires = -1500;
Response.CacheControl = "no-cache";
}
}