Link to home
Start Free TrialLog in
Avatar of garethtnash
garethtnashFlag for United Kingdom of Great Britain and Northern Ireland

asked on

ASP - Session Variables v Cookies

I've been reading up and have come to the conclusion that Session Variables are evil! That Session Variables consume far too many server resources....

So i've decided to use Cookies instead to hold user data... and hold user data on the client ....

But I'm using

<%
Response.Cookies("UserAuth")("Userid")=""
Response.Cookies("UserAuth")("Authentication")=""
If rememberme is null then
Response.Cookies("UserAuth").Expires = dateAdd("n", 20, Now())
end if
%>

Open in new window


And now i think these are server cookies...... are these just as evil as Session Variables?

Thank you
SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of garethtnash

ASKER

Thank you both :)

I read an article from www.4guysfromrolla.com/ - http://www.4guysfromrolla.com/webtech/faq/Advanced/faq4.shtml

I've got a server with 16GB ram which is running slowly, so on the project I'm currently working on, i was looking to reduce server resources!

Mainly though i think the issue is that SQL is using all the ram it can eat,.... but thats another issue!

Thank you
Perfect thank you both
To follow up, the articles on 4guys are very helpful for classic asp.  However, take into consideration the dates these were written and what was available then vs now.  Back in the 2000 to 2003 era, it was probably typical to have 256mb of ram vs 4 to 16 now.    

I have run into issues with session variables though and it does depend on your traffic.  If you have a handful of users or thousands. More importantly how much traffic per second.  If there are only a few users but there are hundreds of calls to the server a second for even a short amount of time, the worker process crashes and resets the session.  

You just have to put it all in perspective.

SQL Server will use up as much memory as you throw at it.  

If your server is running slow, or at least your data is, you want to look at  your types of queries, indexing, and how much data you are throwing at the browser are the 3 major  items I can think of that can really speed things up.  Also if you are using a windows desktop or workstation as your server vs a webserver designed to be a webserver will make a difference.