Session variables

Results 1 to 6 of 6

Thread: Session variables

  1. #1
    Join Date
    Dec 1969
    Posts
    463

    Default Session variables

    I am pretty new to asp, so please bear with me. I&#039ve been told that using session variables in asp is bad, but don&#039t fully understand why? They seem to make everything easier. What is so wrong with them? :)<BR><BR>TIA

  2. #2
    Ian Stallings Guest

    Default RE: Session variables

    The reason is this - each created object takes up a certain<BR>amount of memory on the server. Each time someone accesses<BR>a page with a session object being created it becomes a <BR>performance issue. If your site gets a small amount of<BR>hits then it wont matter. But good coding practices calling<BR>for scalable code, try to stay away from the session object<BR>and instead consider using the GET method or storing variables<BR>in a temporary cookie. I hope this helps.<BR><BR><BR>

  3. #3
    B.H.Carr Guest

    Default RE: Session variables

    Another reason you may have heard that Session variables are bad is the fact that they rely on cookies!<BR><BR>Due to past hype, many people believe cookies are bad, and therefore, disable them. They&#039re scared of potential security risks.<BR><BR>Session variables use client-side cookies. If the user has cookies disabled, your site will not function for them.<BR><BR>B.H.Carr

  4. #4
    F. Louali Guest

    Default RE: Session variables

    Hello,<BR>I am new to asp and I wonder how to keep the good coding practices on an e-commerce site.<BR>We have multiple users selecting multiple items at the same time.<BR>Is it possible to do that using GET or cookies?<BR><BR>Thank you for your time,<BR><BR>Farid<BR>


  5. #5
    Join Date
    Dec 1969
    Posts
    1

    Default RE: Session variables

    I agree with the previous poster that session variables do take up memory on the server and often that can be avoided by simply using cookies. But another major reason not to use session variables is because they make websites completely unscalable. Scalability allows one web server to transfer the current user to another webserver if it gets too overloaded with traffic. But session variables are stored in memory and can not be passed along to any other server, hence, the session would be gone.<BR><BR>The best practice at least for things like shopping carts etc is to develop your own mechanism for maintaining sessions if necessary. Usually a database is a good medium for storing your session data.<BR><BR>Mark

  6. #6
    Join Date
    Dec 1969
    Posts
    3

    Default RE: Session variables

    how can i store variables to a cookie and how can i retrieve it?

Posting Permissions

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