Session Variables

Results 1 to 2 of 2

Thread: Session Variables

  1. #1
    Zawaad Mahatey Guest

    Default Session Variables

    Does anybody know the answert to this ?<BR><BR>Would there be any difference between have say 100 session variables as apposed having a 100 element array stored in 1 session variable.<BR><BR>Surely ITO byte size they are the same ?<BR><BR>Thanks

  2. #2
    Davd Mann Guest

    Default 100 session vars VS a 100 index array.

    In the simplest terms, having a 100 session var setup to store data is VERY BAD. Remember that Session variables are actually Objects that the server opens and stores when requested. The problem isn&#039t really the size of your data (which could be as small as a few bytes), but the size of the Session Object. <BR><BR>When you make a statement such as:<BR><BR>Session("MyName") = "David"<BR><BR>you are telling the ASP engine to generate a Session Object which is sort of like a server-side locker to store that information. Even though the string, "David", isn&#039t all that large in terms of byte size, ASP doesn&#039t know that, as a Session Object can reference anything from the simplest int to the largest Object. That is why people recommend not using Sessions so freely; it creates enough space to store whatever you throw at it, and that can bog down system resources in a heartbeat if you have a site that&#039s getting hit numerous times within a short timespan.<BR><BR>I would personally go with the array setup if anything.... Good luck, and I hope this information proves useful to you.<BR><BR>Sincerely,<BR> --David

Posting Permissions

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