I want that after Logging Out any user should not be able to go to the Back Page. How can i do that?
A:
AFAIK, you can not disable back button of web browser.
Add the following
"if user is logged in"
<% Response.CacheControl = "no-cache" %>
<% Response.AddHeader "Pragma", "no-cache" %>
<% Response.Expires = -1 %>
Ratnesh Maurya
2009-07-10 06:31:19
Suppose i am in a page and i have clicked the logout Button, then it is taking me to Login Page.But if i am Clicking the Back button then it is Displaying me the previous page and its value .How to stop that ?
2009-07-10 06:35:53
as answered by Canavar, clear cache. Add no cache header. Edited my post.
Ratnesh Maurya
2009-07-10 06:39:10
+2
A:
Clear the cache instead, it's more reliable.
Add these to your header section of the page :
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="EXPIRES" CONTENT="0">
And add this to your page load :
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Canavar
2009-07-10 06:31:47
A:
You could try setting no-cache on the pages viewed by authenticated users, that should requier the users browser to reload the page from the server.
Fredrik Leijon
2009-07-10 06:35:23
A:
Disabling the back button is not possible, perfectly. So you can:
- Close the window on Log off.
- On each page, check for a valid session and if not found, redirect to login page.
danish
2009-07-10 06:36:39
1. bad solution2. will not work for back button as browser does not does a post back on back button.
Ratnesh Maurya
2009-07-10 06:43:04
@rats. you are mostly right, but in my experience, safari makes a fresh request on back
Midhat
2009-07-10 06:48:45
i am not sure about safari, but IE, FF and Opera does not do a post back unless you ask them not to cache. :-)
Ratnesh Maurya
2009-07-10 06:55:49