Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. ASP Logout

ASP Logout

Scheduled Pinned Locked Moved ASP.NET
helpquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    berba
    wrote on last edited by
    #1

    Hi When clicking the log out button on my ASP web application, the following is executed Session.Abandon but when i click the back button on the ie browser, i'm being redirected to the previous page though the session has expired. I've tried using the no cache code

    Response.Buffer = True
    Response.ExpiresAbsolute = Now() - 1
    Response.Expires = 0
    Response.CacheControl = "no-cache"

    This has worked as after logout when I clicked on the ie browser back button i'm being redirected to the login page But when the session hasn't expired and the user is using the application and at some point when he clicks the ie browser back button, he is getting the ie error message "Page cannot be displayed". I think this being caused by the no cache code Is there any way to avoid this? Cheers

    A 1 Reply Last reply
    0
    • B berba

      Hi When clicking the log out button on my ASP web application, the following is executed Session.Abandon but when i click the back button on the ie browser, i'm being redirected to the previous page though the session has expired. I've tried using the no cache code

      Response.Buffer = True
      Response.ExpiresAbsolute = Now() - 1
      Response.Expires = 0
      Response.CacheControl = "no-cache"

      This has worked as after logout when I clicked on the ie browser back button i'm being redirected to the login page But when the session hasn't expired and the user is using the application and at some point when he clicks the ie browser back button, he is getting the ie error message "Page cannot be displayed". I think this being caused by the no cache code Is there any way to avoid this? Cheers

      A Offline
      A Offline
      Arun Jacob
      wrote on last edited by
      #2

      I think this is because of the expiry that you have set for the response. Could you please try remove the expiration and only use,

      Response.Cache.SetCacheability(HttpCacheability.NoCache);
      Response.Buffer = True;

      This is not a tested code. If you try this way then it should work. I assume that you have proper session validation logic in your pages.

      Arun Jacob My Technical Blog : Code.NET

      B 1 Reply Last reply
      0
      • A Arun Jacob

        I think this is because of the expiry that you have set for the response. Could you please try remove the expiration and only use,

        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.Buffer = True;

        This is not a tested code. If you try this way then it should work. I assume that you have proper session validation logic in your pages.

        Arun Jacob My Technical Blog : Code.NET

        B Offline
        B Offline
        berba
        wrote on last edited by
        #3

        thanks for the reply but the code you've mentioned is for ASP.Net not ASP. I need for ASP

        modified on Tuesday, September 20, 2011 6:43 AM

        A 1 Reply Last reply
        0
        • B berba

          thanks for the reply but the code you've mentioned is for ASP.Net not ASP. I need for ASP

          modified on Tuesday, September 20, 2011 6:43 AM

          A Offline
          A Offline
          Arun Jacob
          wrote on last edited by
          #4

          Oh, I thought it was for ASP.NET. Could you please try the same logic in ASP (remove the expiration)? You'll find some equivalent snippets in ASP.

          Arun Jacob My Technical Blog : Code.NET

          B 1 Reply Last reply
          0
          • A Arun Jacob

            Oh, I thought it was for ASP.NET. Could you please try the same logic in ASP (remove the expiration)? You'll find some equivalent snippets in ASP.

            Arun Jacob My Technical Blog : Code.NET

            B Offline
            B Offline
            berba
            wrote on last edited by
            #5

            I did but it didn't work out. Was thinking if there is a way to refresh the page when the back button on the ie browser if triggered

            modified on Tuesday, September 20, 2011 8:20 AM

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups