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. Session Variable

Session Variable

Scheduled Pinned Locked Moved ASP.NET
csharpjavaquestion
7 Posts 6 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.
  • A Offline
    A Offline
    ADY007
    wrote on last edited by
    #1

    Hello, can someone describe to me what are session variables please?? Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.

    M _ C 3 Replies Last reply
    0
    • A ADY007

      Hello, can someone describe to me what are session variables please?? Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.

      M Offline
      M Offline
      mnaveed
      wrote on last edited by
      #2

      Here is w3schools defination for session variables:) "Session variables are used to store information about ONE single user, and are available to all pages in one application. Typically information stored in session variables are name, id, and preferences." Nav.

      1 Reply Last reply
      0
      • A ADY007

        Hello, can someone describe to me what are session variables please?? Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.

        _ Offline
        _ Offline
        _AK_
        wrote on last edited by
        #3

        Hi, Go through this link it will be helpful. http://webmonkey.wired.com/webmonkey/03/30/index3a.html?tw=programming Best Regards, Apurva Kaushal

        1 Reply Last reply
        0
        • A ADY007

          Hello, can someone describe to me what are session variables please?? Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.

          C Offline
          C Offline
          CreativeBug
          wrote on last edited by
          #4

          First thing i cleared you session is object, its not a variable. Session object is automatically created every time client browser access pages from your web site. Session object is specific for every user and varies from user to user. It can be used to store variables specific for a user and IIS will maintain these variables when the client moves across pages within your site. // create a new Session variable to store the users name Session ( 'Name' ) = 'Gyanendra'; // display the name in any page on your site Response.write( 'Your name is ' + Session ( 'Name' ) ) The problem that Session variables have to overcome is that the HTTP protocol that you use to browse the web is stateless. Each request for a page is completely independant of earlier requests, so if you want subsequent pages to "remember" the users name that he entered on your front page you have to store that information somewhere. Happy Programming Gyanendra

          A G 2 Replies Last reply
          0
          • C CreativeBug

            First thing i cleared you session is object, its not a variable. Session object is automatically created every time client browser access pages from your web site. Session object is specific for every user and varies from user to user. It can be used to store variables specific for a user and IIS will maintain these variables when the client moves across pages within your site. // create a new Session variable to store the users name Session ( 'Name' ) = 'Gyanendra'; // display the name in any page on your site Response.write( 'Your name is ' + Session ( 'Name' ) ) The problem that Session variables have to overcome is that the HTTP protocol that you use to browse the web is stateless. Each request for a page is completely independant of earlier requests, so if you want subsequent pages to "remember" the users name that he entered on your front page you have to store that information somewhere. Happy Programming Gyanendra

            A Offline
            A Offline
            ADY007
            wrote on last edited by
            #5

            Thanks very much for your feedback yall Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.

            M 1 Reply Last reply
            0
            • A ADY007

              Thanks very much for your feedback yall Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.

              M Offline
              M Offline
              Mihai Drebot
              wrote on last edited by
              #6

              Just one more thing, you can store any object on the session, not just strings: Session.Add("my_object",myObject); myType myObject = (myType) Session["my_object"]; Hope this helps. Mihai Voicu Drebot

              1 Reply Last reply
              0
              • C CreativeBug

                First thing i cleared you session is object, its not a variable. Session object is automatically created every time client browser access pages from your web site. Session object is specific for every user and varies from user to user. It can be used to store variables specific for a user and IIS will maintain these variables when the client moves across pages within your site. // create a new Session variable to store the users name Session ( 'Name' ) = 'Gyanendra'; // display the name in any page on your site Response.write( 'Your name is ' + Session ( 'Name' ) ) The problem that Session variables have to overcome is that the HTTP protocol that you use to browse the web is stateless. Each request for a page is completely independant of earlier requests, so if you want subsequent pages to "remember" the users name that he entered on your front page you have to store that information somewhere. Happy Programming Gyanendra

                G Offline
                G Offline
                Garg Vikas
                wrote on last edited by
                #7

                The beauty of Session, you can store not only string but also object in it. like: oMember = new Members(); Session["loginMember"] = oMember; ================================== Members oMembers; oMembers = (Members)(Session["loginMember"]); Vikas Garg

                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