Print Page | Close Window

Session variable question

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=11062
Printed Date: 29 March 2026 at 7:39pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Session variable question
Posted By: sabrin514
Subject: Session variable question
Date Posted: 01 July 2004 at 3:01pm

I use session variables to store important data from a class object data in a VB. NET multi-user tracking application I designed. Currently we have the application being run from a single server.

The use of session variables in the application works very well; however, I am told that session variables cannot be used in a multiple server environment because the user may be hitting on a different server each time (depending on load distribution) and that this will have an adverse effect.

Can anyone verify this as an issue? If so, what are possible alternatives that involve the least amount of recoding?

Thanks.




Replies:
Posted By: dpyers
Date Posted: 01 July 2004 at 7:18pm

The multi-server issue is true. You'll have to serialize the session object and stash it in a db. Use querystring/get to pass your own unigue session ID/DB key as part of each uri within the site. I seem to recall some pretty good examples of this on http://www.asp.net - www.asp.net and in the mskb.

You'll also have some cert issues if you're using ssl. May need a different type of cert.



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: Mart
Date Posted: 02 July 2004 at 2:52am
 You shouldn't store important information in session variables on shared hosting anyway really . . .


Posted By: Bunce
Date Posted: 05 July 2004 at 4:06am
Originally posted by dpyers dpyers wrote:

The multi-server issue is true. You'll have to serialize the session object and stash it in a db. Use querystring/get to pass your own unigue session ID/DB key as part of each uri within the site. I seem to recall some pretty good examples of this on http://www.asp.net - www.asp.net and in the mskb.

You'll also have some cert issues if you're using ssl. May need a different type of cert.

I don't believe you'll have to make any coding changes at all.

All you need to do is change the location where session info is stored.  You can do this in your web.config.

From memory, there are 3 options - memory (in process), database and one other which I've forgotten. 

This should get around your server-farm issue.

Cheers,
Andrew


EDIT: The other is out of process (state server).  See:
http://www.ondotnet.com/pub/a/dotnet/2003/03/24/sessionstate.html - http://www.ondotnet.com/pub/a/dotnet/2003/03/24/sessionstate .html



-------------
There have been many, many posts made throughout the world...
This was one of them.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net