PDA

Click to See Complete Forum and Search --> : sessions


artsapimp
Aug 19th, 2000, 09:36 AM
I don't really understand sessions. Someone please help with the basic information regarding them. Thanks


<%
Dim strMydata
...
strMydata = "this is my data"
...
session("mydata") = strMydata
%>
...
<% session("mydata") %>


why won't this code write "this is my data" on my screen? it's blank.

compuGEEK
Aug 21st, 2000, 11:48 AM
The session object is used as a means to store information. This is necessary because HTTP is stateless. As an example, if you have a variable on one page and try to pass it to the next page, the information would be lost; unless you pass it in the query string, hidden fields etc...

The session object is a way to maintain and store information for the duration of the end user's "session".

There are many pro's and cons (mostly cons) about using session variables. The biggest, is that the each session variable is stored in the webservers memory. You can imagine the webserver's lack of performance, if you have many simultaneous users at the same time. Also, session variables are essentially, cookies; so if the end user has cookies disabled, you're in trouble.

:)

scottr
Aug 22nd, 2000, 11:57 PM
There are alternatives to session variables. On my site we pass most everything through hidden text fields, and there is always the query string

here are a couple of articles about sessions

http://www.4guysfromrolla.com/webtech/041600-2.shtml
http://www.4guysfromrolla.com/webtech/041399-1.shtml