Last post Mar 17, 2011 10:23 AM by bittermonkey
Mar 16, 2011 09:22 AM|bittermonkey|LINK
My session variables don't get saved if the SessionState mode in the web.config file is set to StateServer. But when I changed it to InProc, then everything is fine and good. I'm trying to save a custom built object (or class) into the session after the
user logs in. Is there any reason for this?
Thanks in advance.
Mar 16, 2011 09:39 AM|Rakeshkr|LINK
u have to start aspnet_state service and also u have to add configuration in web.config.
check this link
Mar 16, 2011 09:46 AM|sandy060583|LINK
Hi bittermonkey ,
if you have done what Rakesh has suggested than one more thing here to check is whether you have serialized your objects that you are storing in session? if not than do it along with web.config settings change with service start asp.net stateservice .
Hope this help !!!
Mar 17, 2011 12:35 AM|sirdneo|LINK
First go through this article to check that have you properly configured state server:-
Also can you explan what you mean by session variables don't get saved?
If you are getting some serilization error then try adding a [Serilizable] tag above your object's class. If that is something else then share with us some details.
Mar 17, 2011 10:23 AM|bittermonkey|LINK
First of all thank you guys for the quick response. It wasn't about the StateServer configuration cause I was pointing my local solution to a remote server. Sandy was right, I have to make the class serializable before I can save it in the session.
Keep it up guys!