When Session Variables Go Bad - Conclusion
(Page 4 of 4 )
So what have we learned from all of this. First, it is not a good idea to store STA objects in the Session variables. You might get away with it on a low volume site, but if you do run into strange problems, be aware that the problem could be causes by STA objects. And, unfortunately, the most common objects used by ASP developers use the STA architecture, namely ADO and FileSystemObjects.
So what have we learned from all of this. First, it is not a good idea to store STA objects in the Session variables. You might get away with it on a low volume site, but if you do run into strange problems, be aware that the problem could be causes by STA objects. And, unfortunately, the most common objects used by ASP developers use the STA architecture, namely ADO and FileSystemObjects.
Second, if you do use Session variables, be aware of how much information is actually being stored. Especially if you have a heavily trafficked site, make sure that you adjust your memory (both physical and virtual) accordingly.
Finally, if you move to a distributed web server environment, the use of Session variables can decrease performance by not letting the load balancing service do its thing. Should you ever use Session variables? They are too compelling (in my opinion) to answer with a flat "NO". However, their simplicity belies the caution and thought that should go into their use.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |