locked
Session does not get saved if SessionState Mode is StateServer RRS feed

  • Question

  • User2120028725 posted

    Hi,

    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.

    Wednesday, March 16, 2011 9:22 AM

Answers

  • User-519136805 posted

    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 !!!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 16, 2011 9:46 AM

All replies

  • User1836848059 posted

    hi,

    u have to start aspnet_state service and also u have to add configuration in web.config.

     <sessionState mode="StateServer"

          stateConnectionString="tcpip=127.0.0.1:42424"

          cookieless="false"

          timeout="30"/>


    check this link

    http://msdn.microsoft.com/en-us/library/ms178586.aspx

    http://www.brainbell.com/tutorials/ASP/Configuring_Session_State.html

    Wednesday, March 16, 2011 9:39 AM
  • User-519136805 posted

    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 !!!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 16, 2011 9:46 AM
  • User-481631678 posted

    First go through this article to check that have you properly configured state server:-

    http://zeeshanumardotnet.blogspot.com/2010/09/aspnet-state-server.html

    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.

    Thursday, March 17, 2011 12:35 AM
  • User2120028725 posted

    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!

    Thursday, March 17, 2011 10:23 AM