Session Variable
-
Hello, can someone describe to me what are session variables please?? Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
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.
-
Hello, can someone describe to me what are session variables please?? Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
Hi, Go through this link it will be helpful. http://webmonkey.wired.com/webmonkey/03/30/index3a.html?tw=programming Best Regards, Apurva Kaushal
-
Hello, can someone describe to me what are session variables please?? Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
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
-
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
-
Thanks very much for your feedback yall Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
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
-
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
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