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. logout problem

logout problem

Scheduled Pinned Locked Moved ASP.NET
help
9 Posts 4 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.
  • M Offline
    M Offline
    mukesh mr03
    wrote on last edited by
    #1

    hi, i'm facing a problem in my logout section. even after logout user can go back to the previous page by clicking browsers back button. i'm using code like this.... its working in Internet Explorer but not working in any other browsers. plz help me.. protected void Page_Load(object sender, EventArgs e) { if (Session["sessionId"] != null) { string name1 = Session["sessionId"].ToString(); } else Response.Redirect("Login.aspx"); Response.Buffer=true; Response.ExpiresAbsolute= DateTime.Now.AddDays(-1); Response.Expires=-1500; Response.CacheControl="no-cache"; } protected void LogOut_Click(object sender, EventArgs e) { Session["sessionId"] = null; Response.Redirect("Login.aspx"); }

    N A 2 Replies Last reply
    0
    • M mukesh mr03

      hi, i'm facing a problem in my logout section. even after logout user can go back to the previous page by clicking browsers back button. i'm using code like this.... its working in Internet Explorer but not working in any other browsers. plz help me.. protected void Page_Load(object sender, EventArgs e) { if (Session["sessionId"] != null) { string name1 = Session["sessionId"].ToString(); } else Response.Redirect("Login.aspx"); Response.Buffer=true; Response.ExpiresAbsolute= DateTime.Now.AddDays(-1); Response.Expires=-1500; Response.CacheControl="no-cache"; } protected void LogOut_Click(object sender, EventArgs e) { Session["sessionId"] = null; Response.Redirect("Login.aspx"); }

      N Offline
      N Offline
      NetBot
      wrote on last edited by
      #2

      its the problem of cache. Try clearing you browsers cache programatically

      M 1 Reply Last reply
      0
      • N NetBot

        its the problem of cache. Try clearing you browsers cache programatically

        M Offline
        M Offline
        mukesh mr03
        wrote on last edited by
        #3

        can plz give me any sample codes for that

        A N 2 Replies Last reply
        0
        • M mukesh mr03

          hi, i'm facing a problem in my logout section. even after logout user can go back to the previous page by clicking browsers back button. i'm using code like this.... its working in Internet Explorer but not working in any other browsers. plz help me.. protected void Page_Load(object sender, EventArgs e) { if (Session["sessionId"] != null) { string name1 = Session["sessionId"].ToString(); } else Response.Redirect("Login.aspx"); Response.Buffer=true; Response.ExpiresAbsolute= DateTime.Now.AddDays(-1); Response.Expires=-1500; Response.CacheControl="no-cache"; } protected void LogOut_Click(object sender, EventArgs e) { Session["sessionId"] = null; Response.Redirect("Login.aspx"); }

          A Offline
          A Offline
          Abhijit Jana
          wrote on last edited by
          #4

          mukesh.mr03 wrote:

          protected void LogOut_Click(object sender, EventArgs e) { Session["sessionId"] = null; Response.Redirect("Login.aspx"); }

          use Session.Abandon while logout

          Best Regards ----------------- Abhijit Jana View My CodeProject Articles "Success is Journey it's not a destination"

          M 1 Reply Last reply
          0
          • M mukesh mr03

            can plz give me any sample codes for that

            A Offline
            A Offline
            Abhijit Jana
            wrote on last edited by
            #5

            Check this one http://www.codeproject.com/asp/user_logtime.asp[^]

            Best Regards ----------------- Abhijit Jana View My CodeProject Articles "Success is Journey it's not a destination"

            1 Reply Last reply
            0
            • M mukesh mr03

              can plz give me any sample codes for that

              N Offline
              N Offline
              NetBot
              wrote on last edited by
              #6

              use Response.Cache.SetCacheability(HttpCacheability.NoCache)

              1 Reply Last reply
              0
              • A Abhijit Jana

                mukesh.mr03 wrote:

                protected void LogOut_Click(object sender, EventArgs e) { Session["sessionId"] = null; Response.Redirect("Login.aspx"); }

                use Session.Abandon while logout

                Best Regards ----------------- Abhijit Jana View My CodeProject Articles "Success is Journey it's not a destination"

                M Offline
                M Offline
                Mack Ait Aoudia
                wrote on last edited by
                #7

                I think the problem is more complicated than just clearing the cache and using session.abandon. I was facing a kind of this problem: click there to see the solution I came up with: http://www.codeproject.com/useritems/go\_back\_refresh\_pages.asp hope it helps!

                Just Relax And Keep It Simple.

                A 1 Reply Last reply
                0
                • M Mack Ait Aoudia

                  I think the problem is more complicated than just clearing the cache and using session.abandon. I was facing a kind of this problem: click there to see the solution I came up with: http://www.codeproject.com/useritems/go\_back\_refresh\_pages.asp hope it helps!

                  Just Relax And Keep It Simple.

                  A Offline
                  A Offline
                  Abhijit Jana
                  wrote on last edited by
                  #8

                  :omg: This link Redirect to a wrong page :wtf: can u kindly rechack the link :) Thanks in advance :rose:

                  Best Regards ----------------- Abhijit Jana View My CodeProject Articles "Success is Journey it's not a destination"

                  M 1 Reply Last reply
                  0
                  • A Abhijit Jana

                    :omg: This link Redirect to a wrong page :wtf: can u kindly rechack the link :) Thanks in advance :rose:

                    Best Regards ----------------- Abhijit Jana View My CodeProject Articles "Success is Journey it's not a destination"

                    M Offline
                    M Offline
                    Mack Ait Aoudia
                    wrote on last edited by
                    #9

                    this is the link: http://www.codeproject.com/useritems/go\_back\_refresh\_pages.asp enjoy and hope it helps!

                    Just Relax And Keep It Simple.

                    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