-
Junior Member
Why logout does not work in ASP.NET
Manually session check to enter in a web page in asp.net. It works fine.When logout, works fine. But, after logout , when press browser back button it back to the previous page, session check not work.Why?
code for page_load() with session check:
protected void page_load()
{
if(session["id"]==null)
{
server.Transfer("../Index.aspx");
else
{
// ....
}
}
}
code for logout button:
{
session["id"]=null;
server.Transfer("../Index.aspx");
}
-
Junior Member
Re: Why logout does not work in ASP.NET
you have to use javascript for disable back button.
Last edited by aditi.ptl; 03-14-2008 at 10:33 AM.
-
Junior Member
Re: Why logout does not work in ASP.NET
Add Session.Abandon();
code for logout button:
{
session["id"]=null;
Session.Abandon();
server.Transfer("../Index.aspx");
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules