TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
satheesh babu
NA
128
312.1k
How to stop to display previous page when user press browser back button after log out?
Aug 25 2011 2:43 AM
Hi all,
For log in button i am checking the user id & password in data base and creating session object. In all pages page_load event I am checking the session & if the session exists then only i am displaying the page other wise i am redirecting to log in page.
Here I wrote below code for log out button. After log out click , i am redirecting to login.aspx page,its displaying login page , but if i press browser back button, its redirecting to my previous page and if I did any functionality then its checking the session object then its redirecting to log in page.
Please guide me how to stop my browser back button to don't display my previous page?
Session.Abandon();
Session.RemoveAll();
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Session.Clear();
Session["User_Name"] = null;
Session["Subscriber_Id"] = null;
Session["ACCOUNT_ACCESS_TYPE"] = null;
Session["User_Id"] = null;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d);
Response.Expires = -1500;
Response.CacheControl = "no-cache";
String script = "<script type=text/javascript\"" + ">window.history.forward(1)</script>";
Page.RegisterClientScriptBlock("backbutton", script);
Response.Redirect("~/SignIn.aspx");
Reply
Answers (
1
)
Capture Windows logon event from a service
Menu ,highlight the selected menu item & not clickable the current selected menu item