Link to home
Start Free TrialLog in
Avatar of IKtech
IKtech

asked on

sql session state (asp.net)

I have two server 2008 R2 64 bit servers running IIS for our webservers.  We have an application hosted on theses servers that is .net.  I want to try and use our sql server for session state but i am new to this topic and wanted to see what advice i could get from the experts.

Please let me know what, if any, documents have helped you set up a sql session state server.  Also i would like to know if there is anything to watch out for or any issues with a similar setup.

The reason i am even attempting this is because i have had a few instances where users are kicked out and sent to the login page when they lose there session state.  So i am open to suggestions on how to remedy that situation however i thought the sql system state might solve the problem.  Thanks!
Avatar of IKtech
IKtech

ASKER

it's probably worth mentioning that the sql server i want to use is a 2008 sql server.
Avatar of Craig Wagner
It's really pretty simple. You run a script that creates a couple of tables and change the <sessionState> element in your web.config and you're done. This article explains how to do it.

http://support.microsoft.com/kb/317604

None of your code changes at all.

As far as your users getting kicked out because they lose their session state, that may be related to the session timing out or it may be related to the user being bounced from one server to another by the load balancer. You need to figure out which it is because simply moving the sessionState to the database won't solve the problem if it's due to the session timing out.
Its good to use a sql session state. Make sure the objects you are setting to sessions are serializable (e.g. Classes) and the timeout period is not too high (20min is best)
ASKER CERTIFIED SOLUTION
Avatar of IKtech
IKtech

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 IKtech

ASKER

IT works!