FormsAuthentication client-side problem

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default FormsAuthentication client-side problem

    I'm using FormsAuthentication to secure access to a web site. The
    authentication process works correctly initially. The pages on the site have
    a "logout" button, which basically call FormsAuthentication.SignOut() and
    redirect the user to the login page.

    The problem is that after the user logs out, if they were to use their
    browser's "Back" button (or even enter the url to the page directly on the
    browser), they are allowed into that page. This is probably because the
    browser is simply re-rendering the page without going back to the server
    (I've verified that it does not go back to the server by placing a
    breakpoint on page_load). Interestingly enough, if you enter a url for a
    page on that web site that was not navigated to while the user had been
    authenticated, then it correctly kicks them to the login page. But any page
    that was visited during the authenticated session continues to be available
    on that browser even after SignOut.

    Since this needs to be solved on the client side, I'm trying to implement
    something using the client's onload event, which is raised every time the
    browser renders the page (whether through Back button, etc). But the problem
    is that with client-side scripting like javascript or vbscript I don't have
    access to session variables and such - which I could otherwise use to
    indicate that the user is no longer authenticated. So I'm at a loss as to
    how to handle this.

    If someone has dealt with this before, I'd much appreciate pointing me in
    the right direction.

    Thanks


    Marcio Kleemann Guest

  2. Similar Questions and Discussions

    1. Problem with client side active x
      Hi All, Hope you can help / point me in the right direction with a little problem. I have a VB6 created active X dll which is downloaded to the...
    2. Client side dynamic graphing problem
      I am familiar with application programming, but only started web-programming a month ago. I want to have a graph on a webpage that the client can...
    3. problem Calling webservice from client side javascript
      I have a problem calling webservice from client side javascript. The javascript call the settimeout() method. when the user press submit button it...
    4. Client side and server side scripting problem
      Hiya I have a problem with using some client side and server side scripting together in an ASP. I'm using VBScript. What I'm trying to achieve...
    5. Client-side Cert Web application problem
      I had the same problem about a year ago. I currently don't have a link to the article, but there's one on MSDN (I think it's part of a book...
  3. #2

    Default Re: FormsAuthentication client-side problem

    Marcio,

    Try this in your Page_Load:

    Response.Cache.SetCacheability(HttpCacheability.No Cache);

    --
    Regards,
    Wes Henderson

    In order to help everyone, please direct all replies to this newsgroup.
    This posting is my personal effort to provide help and is not on behalf of
    any company.
    Also, this posting is provided "AS IS" with no expressed or implied
    warranties.

    "Marcio Kleemann" <notavailable> wrote in message
    news:%23lcWvF3QEHA.624@TK2MSFTNGP11.phx.gbl...
    > I'm using FormsAuthentication to secure access to a web site. The
    > authentication process works correctly initially. The pages on the site
    have
    > a "logout" button, which basically call FormsAuthentication.SignOut() and
    > redirect the user to the login page.
    >
    > The problem is that after the user logs out, if they were to use their
    > browser's "Back" button (or even enter the url to the page directly on the
    > browser), they are allowed into that page. This is probably because the
    > browser is simply re-rendering the page without going back to the server
    > (I've verified that it does not go back to the server by placing a
    > breakpoint on page_load). Interestingly enough, if you enter a url for a
    > page on that web site that was not navigated to while the user had been
    > authenticated, then it correctly kicks them to the login page. But any
    page
    > that was visited during the authenticated session continues to be
    available
    > on that browser even after SignOut.
    >
    > Since this needs to be solved on the client side, I'm trying to implement
    > something using the client's onload event, which is raised every time the
    > browser renders the page (whether through Back button, etc). But the
    problem
    > is that with client-side scripting like javascript or vbscript I don't
    have
    > access to session variables and such - which I could otherwise use to
    > indicate that the user is no longer authenticated. So I'm at a loss as to
    > how to handle this.
    >
    > If someone has dealt with this before, I'd much appreciate pointing me in
    > the right direction.
    >
    > Thanks
    >
    >

    Wes Henderson Guest

  4. #3

    Default Re: FormsAuthentication client-side problem

    That did it - thanks!

    "Wes Henderson" <wes1024@hotmail.com.nospam> wrote in message
    news:%236cKE35QEHA.3748@TK2MSFTNGP09.phx.gbl...
    > Marcio,
    >
    > Try this in your Page_Load:
    >
    > Response.Cache.SetCacheability(HttpCacheability.No Cache);
    >
    > --
    > Regards,
    > Wes Henderson
    >
    > In order to help everyone, please direct all replies to this newsgroup.
    > This posting is my personal effort to provide help and is not on behalf of
    > any company.
    > Also, this posting is provided "AS IS" with no expressed or implied
    > warranties.
    >
    > "Marcio Kleemann" <notavailable> wrote in message
    > news:%23lcWvF3QEHA.624@TK2MSFTNGP11.phx.gbl...
    > > I'm using FormsAuthentication to secure access to a web site. The
    > > authentication process works correctly initially. The pages on the site
    > have
    > > a "logout" button, which basically call FormsAuthentication.SignOut()
    and
    > > redirect the user to the login page.
    > >
    > > The problem is that after the user logs out, if they were to use their
    > > browser's "Back" button (or even enter the url to the page directly on
    the
    > > browser), they are allowed into that page. This is probably because the
    > > browser is simply re-rendering the page without going back to the server
    > > (I've verified that it does not go back to the server by placing a
    > > breakpoint on page_load). Interestingly enough, if you enter a url for a
    > > page on that web site that was not navigated to while the user had been
    > > authenticated, then it correctly kicks them to the login page. But any
    > page
    > > that was visited during the authenticated session continues to be
    > available
    > > on that browser even after SignOut.
    > >
    > > Since this needs to be solved on the client side, I'm trying to
    implement
    > > something using the client's onload event, which is raised every time
    the
    > > browser renders the page (whether through Back button, etc). But the
    > problem
    > > is that with client-side scripting like javascript or vbscript I don't
    > have
    > > access to session variables and such - which I could otherwise use to
    > > indicate that the user is no longer authenticated. So I'm at a loss as
    to
    > > how to handle this.
    > >
    > > If someone has dealt with this before, I'd much appreciate pointing me
    in
    > > the right direction.
    > >
    > > Thanks
    > >
    > >
    >
    >

    Marcio Kleemann Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139