469,341 Members | 7,742 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,341 developers. It's quick & easy.

How to restrict the user to login by browser back button even after log out

I am working on web application. I am facing a problem that when logout from my website i was redirected to my login page but when i click on back button of browser i was again able to access my web pages that should be visible after login. Please help me its very urgent

i have this code
Response.Buffer = True
Response.Expires = 0
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1)
Response.CacheControl = "no-cache"

but this is not working in mozilla browser
Sep 7 '10 #1
4 2301
569 Expert 512MB
Why did you not reply in the topic I gave you this code? Where did you add this code in your page? And do you even understand what it means or didn't you bother to find out?

Sep 13 '10 #2
sir i have applied this code in page load of my login page so that when i logout from my site cache get cleared according to your code n sir its working in IE but not in mozilla
Sep 13 '10 #3
390 Expert 256MB
try this
pages.Response.Cache.SetExpires(DateTime.Parse(Dat eTime. Now.ToString()))

Response.Cache.SetCacheability(HttpCacheability.Pr ivate)
Response.AppendHeader("Pragma", "no-cache")
Sep 13 '10 #4
9,735 Expert Mod 8TB
Setting the "cache" meta tag is only a suggestion for web browsers and is not going work all the time.

The only way that I was able to successfully implement such a solution was wrap the page content in an UpdatePanel. When you put your content in an UpdatePanel, everything the user does on the page is done asynchronously. That means when the user hits the back button, the page will appear as if it were the first time loading.

Sep 14 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Michael G | last post: by
5 posts views Thread by Mr Newbie | last post: by
2 posts views Thread by Liming | last post: by
5 posts views Thread by ns21 | last post: by
3 posts views Thread by Ian Semmel | last post: by
2 posts views Thread by =?Utf-8?B?SmVmZiBEb25rZXJzZ29lZA==?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.