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. How to store the userId and password in session and Killing the session?

How to store the userId and password in session and Killing the session?

Scheduled Pinned Locked Moved ASP.NET
helptutorialquestion
4 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
    mcmilan
    wrote on last edited by
    #1

    Hi, After Logging-in how to store the UserId and Password in session.... If the user clicks the Back or Previous button from the browser tool bar then how to kill the session......? Please help me..... Thanking you Mcmilan.

    I R D 3 Replies Last reply
    0
    • M mcmilan

      Hi, After Logging-in how to store the UserId and Password in session.... If the user clicks the Back or Previous button from the browser tool bar then how to kill the session......? Please help me..... Thanking you Mcmilan.

      I Offline
      I Offline
      Imran Khan Pathan
      wrote on last edited by
      #2

      mcmilan wrote:

      After Logging-in how to store the UserId and Password in session....

      Why do you want to store password in session? To store variable in session,

      Session["MyKey"]=VariableName;

      mcmilan wrote:

      If the user clicks the Back or Previous button from the browser tool bar then how to kill the session......?

      You can't. Onclick of browser Back or previous button,Just history of browser is change and content of page get back from cache memory.Page is not reloaded so you can not run code.

      please don't forget to vote on the post that helped you.

      1 Reply Last reply
      0
      • M mcmilan

        Hi, After Logging-in how to store the UserId and Password in session.... If the user clicks the Back or Previous button from the browser tool bar then how to kill the session......? Please help me..... Thanking you Mcmilan.

        R Offline
        R Offline
        Ryomin
        wrote on last edited by
        #3

        If you put Session.Abandon(); in the page_load then that should do the trick. The only issue is that it will abandon the session everytime the user goes to that page. Not a big deal if it's on the Login page though. Hope this helps.

        Cheers Disgyza Programmer Analyst

        1 Reply Last reply
        0
        • M mcmilan

          Hi, After Logging-in how to store the UserId and Password in session.... If the user clicks the Back or Previous button from the browser tool bar then how to kill the session......? Please help me..... Thanking you Mcmilan.

          D Offline
          D Offline
          deepthy p m 0
          wrote on last edited by
          #4

          Session["UserId"]=txtuserid.text.trim(); To clear session Session.Abandon();

          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