caching? problem with forms authentication and IE (but not Netscape?)

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

  1. #1

    Default caching? problem with forms authentication and IE (but not Netscape?)

    I have a web application with at least three pages:

    /index.aspx (home page)
    /login.aspx (login page)
    /my/portfolio.aspx (private page - needs authentication)

    If I attempt to go directly to the private page, I am properly
    redirected to the login page. If the login is successful, I am then
    redirected to the private page. Once I'm on the private page, I click
    on an image button to logout, which logs me out by effectively
    deleting the non-persistent authentication cookie, and then redirects
    me back to the home page.

    Then, when I am using IE, if I attempt to go directly to the private
    page again, I can see it, or at least a cached version of it. I am not
    redirected to the login page as I should be. If I push reload on the
    browser, I see the login page instead, although the URL in the address
    window implies that I'm still looking at the private page. However, if
    I clear the temporary files in IE right before I attempt to go
    directly back to the private page, then I am properly redirected to
    the login page (with the correct URL displayed in the address bar).

    If I use Netscape, everything appears to work fine on the first try
    (unlike IE). I don't have to clear the cache.

    Is this a bug in ASP.NET (server-side), IE (client-side), or a
    user-error?

    Do I need to explicitly disable caching on all of my private pages?
    If so, should I do it like this (from the Page_Load method of my
    private page)?

    Response.AppendHeader("pragma","no-cache");
    Response.AppendHeader("cache-control", "no-cache");

    Thanks for any help or insight!

    Chuck
    Chuck Doucette Guest

  2. Similar Questions and Discussions

    1. Problem with CF Forms caching code changes
      Hi all, I've been having a problem with code changes in CF MX7 not being reflected when I test my programs. I have a very small form that...
    2. Problem in forms authentication
      Hi friends, We have an web application which contains several folders & we are trying to implement forms authentication. Login page for the...
    3. forms authentication problem
      I tried on the Security newgroup, as well as other places, and haven't gotten an answer yet - - I'm pulling my hair out over this one. I'm trying...
    4. Problem with Forms Authentication
      I have an application using FormsAuthentication that does not persist the authentication cookie beyond the session so each time a user starts a...
    5. ssl with <forms authentication> and loginurl problem
      Hi, I've configured SSL with server certificates on a IIS with W2K. Itested it ans works with simple html pages. I want the login page to be under...
  3. #2

    Default Re: caching? problem with forms authentication and IE (but not Netscape?)

    When I explicitly disabled client-side (browser) caching as I described below,
    my application worked as expected. After I logged out, I was not able to
    view the private page again but was redirected to the login page instead
    (as I should be).

    So, isn't this an IE bug, or is it IEs right to try to cache whatever it
    wants to unless I tell it otherwise? Do I need to set some sort of expiration?

    Thanks,
    Chuck

    [email]cdoucette@med-learn.com[/email] (Chuck Doucette) wrote in message news:<62f8bf72.0309221515.4deb072d@posting.google. com>...
    > I have a web application with at least three pages:
    >
    > /index.aspx (home page)
    > /login.aspx (login page)
    > /my/portfolio.aspx (private page - needs authentication)
    >
    > If I attempt to go directly to the private page, I am properly
    > redirected to the login page. If the login is successful, I am then
    > redirected to the private page. Once I'm on the private page, I click
    > on an image button to logout, which logs me out by effectively
    > deleting the non-persistent authentication cookie, and then redirects
    > me back to the home page.
    >
    > Then, when I am using IE, if I attempt to go directly to the private
    > page again, I can see it, or at least a cached version of it. I am not
    > redirected to the login page as I should be. If I push reload on the
    > browser, I see the login page instead, although the URL in the address
    > window implies that I'm still looking at the private page. However, if
    > I clear the temporary files in IE right before I attempt to go
    > directly back to the private page, then I am properly redirected to
    > the login page (with the correct URL displayed in the address bar).
    >
    > If I use Netscape, everything appears to work fine on the first try
    > (unlike IE). I don't have to clear the cache.
    >
    > Is this a bug in ASP.NET (server-side), IE (client-side), or a
    > user-error?
    >
    > Do I need to explicitly disable caching on all of my private pages?
    > If so, should I do it like this (from the Page_Load method of my
    > private page)?
    >
    > Response.AppendHeader("pragma","no-cache");
    > Response.AppendHeader("cache-control", "no-cache");
    >
    > Thanks for any help or insight!
    >
    > Chuck
    Chuck Doucette Guest

  4. #3

    Default Re: caching? problem with forms authentication and IE (but not Netscape?)

    Hi Chuck!
    We just added the below code, and this seems to have fixed the problem for IE7.
    <HEAD>
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="-1">
    </HEAD>
    Elizebethsoumya Joseph is offline Junior Member
    Join Date
    Sep 2010
    Posts
    1

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