Browser's Back Button

Discussion in 'ASP .Net' started by A.M, Aug 3, 2004.

  1. A.M

    A.M Guest

    Hi,

    When I call FormsAuthentication.SignOut(); the user is not authenticated
    anymore, but if user clicks on browser's Back button, all previously viewed
    pages are viewable.

    How can I prevent users seeing prevoiusly viewed pages using browser's Back
    Button ?

    Thanks,
    Alan
    A.M, Aug 3, 2004
    #1
    1. Advertising

  2. A.M

    bruce barker Guest

    you need to expire them, so they can not be read from the browsers cache.
    note: this will cause a the browser to raise an alert box (must repost data)
    whenever the user uses the back button, even when logged in.

    -- bruce (sqlwork.com)

    "A.M" <> wrote in message
    news:...
    > Hi,
    >
    > When I call FormsAuthentication.SignOut(); the user is not authenticated
    > anymore, but if user clicks on browser's Back button, all previously

    viewed
    > pages are viewable.
    >
    > How can I prevent users seeing prevoiusly viewed pages using browser's

    Back
    > Button ?
    >
    > Thanks,
    > Alan
    >
    >
    >
    >
    bruce barker, Aug 3, 2004
    #2
    1. Advertising

  3. A.M

    Raterus Guest

    First off, realize that they aren't going to see anything they hadn't seen before...

    Take a look at this, as I believe this is the more preferred method in asp.net
    http://samples.gotdotnet.com/quickstart/aspplus/doc/outputcaching.aspx

    Also, you can set Response.Expires = 0 to instruct the browser that all authenticated content expires immediately, that way they browser will "hopefully" not show a cached version. I bet you can set this in global.asax in the Sub Application_BeginRequest and handle every page in your application. Realize though that this method was provided for compatibility with classic asp pages.

    --Michael

    "A.M" <> wrote in message news:...
    > Hi,
    >
    > When I call FormsAuthentication.SignOut(); the user is not authenticated
    > anymore, but if user clicks on browser's Back button, all previously viewed
    > pages are viewable.
    >
    > How can I prevent users seeing prevoiusly viewed pages using browser's Back
    > Button ?
    >
    > Thanks,
    > Alan
    >
    >
    >
    >
    Raterus, Aug 3, 2004
    #3
  4. The page is probably being cached.
    To turn off caching for the page, use this code:

    Response.Expires = 0
    Response.Cache.SetNoStore()
    Response.AppendHeader("Pragma", "no-cache")

    Also note that if you pop open a new window, that window has no history so
    the back button will be disabled.

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net


    "A.M" <> wrote in message
    news:...
    > Hi,
    >
    > When I call FormsAuthentication.SignOut(); the user is not authenticated
    > anymore, but if user clicks on browser's Back button, all previously

    viewed
    > pages are viewable.
    >
    > How can I prevent users seeing prevoiusly viewed pages using browser's

    Back
    > Button ?
    >
    > Thanks,
    > Alan
    >
    >
    >
    >
    Steve C. Orr [MVP, MCSD], Aug 4, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    7,150
  2. Steve C. Orr, MCSD

    Re: Browser-History-Back Button

    Steve C. Orr, MCSD, Aug 15, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    2,183
    mathieu cupryk
    Aug 16, 2003
  3. sylvia sil
    Replies:
    1
    Views:
    600
    Curt_C [MVP]
    Dec 29, 2004
  4. Author
    Replies:
    6
    Views:
    3,071
    George
    Jan 22, 2009
  5. Useful Info

    Firefox back button takes me back 2 pages.

    Useful Info, Jun 3, 2007, in forum: Javascript
    Replies:
    0
    Views:
    332
    Useful Info
    Jun 3, 2007
Loading...

Share This Page