barski Posted March 17, 2004 Posted March 17, 2004 I really want to get away from using cookies and would prefer to use session variables. I have a website that at most would have 1000 to 1200 concurrent users and I would like to store certain information about the user in session variables. Specifically the information would be small like username, password, companyid, groupid etc... How expensive would this be? Also, this may be a really really stupid question but can you store a class instance in a session variable and have access to all of it's fields and methods? For example, if I wanted to keep a running total of all the transactions performed by user x then in a desktop app I could simply classinstance.runningtotal += classinstance.transaction. Like I said this could be a ridiculous question but why not ask? Quote
kahlua001 Posted March 17, 2004 Posted March 17, 2004 Depends on your server's resources. Is it a shared plan or dedicated server? Is your state server in process or in a db? What's wrong with using cookies? Quote
barski Posted March 17, 2004 Author Posted March 17, 2004 Depends on your server's resources. Is it a shared plan or dedicated server? Is your state server in process or in a db? What's wrong with using cookies? It is a dedicated server. I don't know state server then it would be whatever it default's to. I would like to limit what i put on the client machine. It's just a personal preference that the more I can control the better I like. I do have several js scripts that I run but I don't know of an alternative for that with cookies however my hope was that a session variable would be a reasonable alternative. Quote
kahlua001 Posted March 17, 2004 Posted March 17, 2004 Well consider if you have 1200 users, each taking up a few KB of memory. Figure what your server can do, how much RAM, what services this dedicated server is responsible for. Most importantly, be careful with what you put into your session variables if performance is an issue. I know that my server wouldnt be able to do that :p Quote
barski Posted March 17, 2004 Author Posted March 17, 2004 Well consider if you have 1200 users' date=' each taking up a few KB of memory. Figure what your server can do, how much RAM, what services this dedicated server is responsible for. Most importantly, be careful with what you put into your session variables if performance is an issue. I know that my server wouldnt be able to do that :p[/quote'] I guess it's like most things if I want more "control" then I'm going to have to give up something. Maybe cookies aren't so bad but then again........ Quote
*Gurus* Derek Stone Posted March 18, 2004 *Gurus* Posted March 18, 2004 You do realize sessions use cookies right? Quote Posting Guidelines
barski Posted March 18, 2004 Author Posted March 18, 2004 You do realize sessions use cookies right? Uhh No I didn't. So if the users browser doesn't have cookies enabled then the session variables won't work. Quote
Administrators PlausiblyDamp Posted March 18, 2004 Administrators Posted March 18, 2004 In a nutshell yes. You can enable cookieless session from web.config but this comes with it's own set of problems. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.