Results 1 to 3 of 3

Thread: sessions

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    323
    I don't really understand sessions. Someone please help with the basic information regarding them. Thanks

    Code:
    <%
    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.
    If you think education is expensive, try ignorance.

  2. #2
    Hyperactive Member compuGEEK's Avatar
    Join Date
    May 1999
    Location
    Mpls,MN,USA
    Posts
    281
    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.


  3. #3
    Lively Member
    Join Date
    May 1999
    Posts
    89
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width