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 session variable

how to session variable

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nettutorial
3 Posts 3 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.
  • R Offline
    R Offline
    rao raja
    wrote on last edited by
    #1

    hi i want to know how to use session variable in asp.net2005 and why it is used. and while doing coding at which place this should be written. thanks

    M N 2 Replies Last reply
    0
    • R rao raja

      hi i want to know how to use session variable in asp.net2005 and why it is used. and while doing coding at which place this should be written. thanks

      M Offline
      M Offline
      Marcus J Smith
      wrote on last edited by
      #2

      Session variables allow you to store information between post backs. The web is stateless, meaning that it doesnt know what it sent you what you are doing or anything between server hits, so to maintain this you can use session variables/cookies/etc... The session variables can be set simply by coding Session("VariableName") = Value and then can be retrieved by coding Value = Session("VariableName"). The session is maintained by a SessionID that is created at the first request and is stored as a session cookie in the user's browser in most cases.


      Cleako

      1 Reply Last reply
      0
      • R rao raja

        hi i want to know how to use session variable in asp.net2005 and why it is used. and while doing coding at which place this should be written. thanks

        N Offline
        N Offline
        Neeraj Arora
        wrote on last edited by
        #3

        As cleako has described session mentain user information. it can be stored at client side or server side both. At client side, it is stored in cookies and if cookies are disabled then automatically it goes to server. You can keep your session data in database also which is most effective. I hope, this information will help you a bit.

        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