2

I have used HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache) in the page load event in all pages

After logging off, when the browser back button is pressed,

the textbox values of username and password still exist.

Since the values are not cleared, the user can log in to the system without entering the username and password.

How to clear the textbox values? How to solve this issue?

Thanx in advance.

3 Answers 3

1

Try this code, hope it works

Response.Cache.SetCacheability(HttpCacheability.NoCache);

Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));

Response.Cache.SetNoStore();
0
0

this may help: http://forums.asp.net/t/1308836.aspx . If not, please provide some more context (are you using ASP.NET? Are you using a proxy (e.g. Fiddler)? etc..)

3
  • When it comes to caching I like to use Firefox with this plugin: chrispederick.com/work/web-developer ... if you don't already have this installed, I would highly suggest it - I have found it very useful for identifying the source of caching related issues. I mention the proxy as there were a few times I was using Fiddler and Fiddler had cached my data before I had explicitly declared the [OutputCache(NoStore = true)] attribute (this is in ASP.NET MVC3). Since clearing my cache didn't work, I selected "Disable Proxy" from the Web-Developer toolbar and everything worked as expected.
    – Jordan
    May 27, 2011 at 11:19
  • The link that you have provided forums.asp.net/t/1308836.aspx is not useful for me. The issue still exist
    – poornima
    May 27, 2011 at 11:37
  • csharpdotnetfreak.blogspot.com/2008/12/… . This link helped me to find a solution.
    – poornima
    Jun 8, 2011 at 5:55
0

Two things:

  • Make sure the FORM tag has the attribute autocomplete="off" (the browser could be storing these values independent of HTML cache settings)
  • Make sure the web browser is set to download newer versions of stored pages "automatically" or "always" (Internet Explorer can sometimes be set to "never" download fresh pages)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.