Home » questions » Yahoo Mail Sign out - inability to use Back button?

Yahoo Mail Sign out - inability to use Back button?

2006-08-11 13:44:38, Category: Programming & Design
I am a programmer and I'm writing some application in .NET. In that application, after user logs out, they are still able to use the BACK button and are able to read-only the information the were able to view before they logged out. I am destroying the FormsAuthentication ticket and Session, but I cannot figure out how to get rid of this Back button issue. I want my application to exibit the same behavior that Yahoo! Mail exibits: after you sign out, you are not able to go back (even by using the Back button in the browser), without signing back in. Any help would be REALLY appreciated!!! Thanks!

Answers

  1. nicey_zzzz

    On 2006-08-11 14:20:30


    Set the Expires header to zero (or to a date long ago), and set the Pragma: no-cache header. I'm a Java programmer, but the code is basic. response.setDateHeader("Expires", 0); response.setHeader("Pragma", "no-cache"); This works by telling the browser that the data it's showing is already out of date. If the user clicks back, then the browser will attempt to connect to the server to re-get it, but this will fail because the session is ended. You should typically set these headers on all dynamic content pages as otherwise they won't update when underlying data changes until the page expires.
  2. sheeple_rancher

    On 2006-08-11 13:53:26


    I'm going to guess that they have javascript on the page that either talks to their server when the page you back up to gets focus or it could cause another page to load or clear the page or other things.