I don't get it..

Results 1 to 2 of 2

Thread: I don't get it..

  1. #1
    Join Date
    Dec 1969

    Default I don't get it..

    It seems very clear that experts in the field have said in various posts / messages / articles I have read. "Do not use ASP Session Object!" but yet individuals are STILL writing stuff like this.<BR><BR>"Cookies are actually a very cool thing, even if they are kind of creepy ("You mean a Web site can put something on my computer?!?! Outrage!") and horribly unsafe (there have been too many security holes that have allowed unauthorized users to get hold of cookies).<BR><BR>Although cookies are poorly suited for storing credit card numbers and phone numbers, they are well suited to storing meaningless information, which means that it&#039;s possible to use cookies to assign unique ids to everyone who visits your site—then to store information that one would not want to share (credit card info, etc. …) in a safe place and reference the private information with the unique id stored in the cookie.<BR><BR>Which is what the ASP Session object does.<BR><BR>This means that one of the great challenges of building a shopping cart—keeping track of unique visitors to a site—is already taken care of with ASP. Any user-specific information that you want to keep track of can be stored in the ASP Session object. It&#039;s very sweet.<BR>"<BR><BR>What is the TRUTH on this matter???

  2. #2
    Join Date
    Dec 1969

    Default You read too many OLD articles

    In 1997 or so, when I first started using ASP, my computer had a whopping 48MB of RAM. To even dream of dedicating, say, 10MB or 20MB of RAM to sesion variables was a nutso idea.<BR><BR>Today, even my "toy" computer has 384MB of RAM. 20MB just for session variables? Sure! Why not!<BR><BR>So do the math...<BR><BR>How many visitors will your site get, per hour? Say 20,000? And how much info do you need to store in session variables, per user? Say a shopping cart with an average of 5 items?<BR><BR>Okay, productID, quantity, productName, price?<BR>Or maybe something like this:<BR>http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=63<BR><BR>So maybe 3 strings per item, 20 characters per string: 60 characters, 120 bytes (2 bytes per character--Unicode, remember). Plus 5*16 bytes per field in each item. 80 bytes. Total 200 bytes.<BR><BR>Say 5 items in the cart. 5 * 200: 1000 bytes.<BR><BR>Let&#039;s even double that, including all the overhead we can think of: 2KB per user!<BR><BR>20,000 users per hour, each stays 10 minutes, you aren&#039;t smart at all about session management. So you have 10,000 simultaneous sessions, average. Times 2KB. A grand total of 20MB. Like I said/guessed.<BR><BR>Whoopeee. Who cares?<BR><BR>Get up to 200,000 visitors per hour...ehhh...you got more problems than just needing 200MB for session variables. You need other solutions, anyway.<BR><BR>Stop reading articles written before about 2002.<BR><BR><BR>

Posting Permissions

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