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. have a problem with sessions

have a problem with sessions

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-nettutorial
7 Posts 5 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.
  • K Offline
    K Offline
    kheer
    wrote on last edited by
    #1

    i am new to ASP.NET Now i am creating a login page i am using sessions to display the username Session["str"] = TextBox1.Text; i am using this Session["str"] where ever i need to display the username The Problem is when i click logout the sessions are not removed how to clear the sessions. i want help......... :|

    S B 2 Replies Last reply
    0
    • K kheer

      i am new to ASP.NET Now i am creating a login page i am using sessions to display the username Session["str"] = TextBox1.Text; i am using this Session["str"] where ever i need to display the username The Problem is when i click logout the sessions are not removed how to clear the sessions. i want help......... :|

      S Offline
      S Offline
      Sneha Bisht
      wrote on last edited by
      #2

      The Abandon method destroys all the objects stored in a Session object and releases their resources use , session.Abandon ; or set session["str"]=null;

      K 1 Reply Last reply
      0
      • S Sneha Bisht

        The Abandon method destroys all the objects stored in a Session object and releases their resources use , session.Abandon ; or set session["str"]=null;

        K Offline
        K Offline
        kheer
        wrote on last edited by
        #3

        i have got it but have one problem after logging out when i press back button every thing remains the same which should not happen how to do this

        N 1 Reply Last reply
        0
        • K kheer

          i am new to ASP.NET Now i am creating a login page i am using sessions to display the username Session["str"] = TextBox1.Text; i am using this Session["str"] where ever i need to display the username The Problem is when i click logout the sessions are not removed how to clear the sessions. i want help......... :|

          B Offline
          B Offline
          Brij
          wrote on last edited by
          #4

          You can Clear the session or abondon the session as Session.Abandon(); or Session.Clear(); for back button, You have two option a: disable the back button b: clear the hostory both can be done using javascript

          Cheers!! Brij

          K N 2 Replies Last reply
          0
          • B Brij

            You can Clear the session or abondon the session as Session.Abandon(); or Session.Clear(); for back button, You have two option a: disable the back button b: clear the hostory both can be done using javascript

            Cheers!! Brij

            K Offline
            K Offline
            Krazy Programmer
            wrote on last edited by
            #5

            Brij wrote:

            You have two option a: disable the back button b: clear the hostory

            option a to my knowledge it cant be done , Please provide the code for it option b. Yes , Playing with windows history can restrict user from going back

            If You win You need not Explain............ But If You Loose You Should not be there to Explain......

            1 Reply Last reply
            0
            • K kheer

              i have got it but have one problem after logging out when i press back button every thing remains the same which should not happen how to do this

              N Offline
              N Offline
              N a v a n e e t h
              wrote on last edited by
              #6

              kiranreddy wrote:

              every thing remains the same which should not happen

              You are seeing browser cached version of the page. This can't be stopped effectively.

              Navaneeth How to use google | Ask smart questions

              1 Reply Last reply
              0
              • B Brij

                You can Clear the session or abondon the session as Session.Abandon(); or Session.Clear(); for back button, You have two option a: disable the back button b: clear the hostory both can be done using javascript

                Cheers!! Brij

                N Offline
                N Offline
                N a v a n e e t h
                wrote on last edited by
                #7

                Brij wrote:

                You can Clear the session or abondon the session as Session.Abandon(); or Session.Clear(); for back button,

                No. No events are fired when back button is pressed.

                Brij wrote:

                disable the back button

                No reliable methods are available.

                Brij wrote:

                clear the hostory

                Not possible.

                Navaneeth How to use google | Ask smart questions

                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