views:

30

answers:

1

How would one go about making sure the InProc session memory gets stored in a DB so it's possible to restart the web-server without losing sessions?

+2  A: 

Have a look at http://msdn.microsoft.com/en-us/library/ms178586.aspx

Change SessionMode from "InProc" to "SQLServer" and insert the connectionstring to the sqlserver.

Edit after your comment:

Using this mode ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm.

citronas
Maybe I'm blind but I couldn't find out if this loses the current sessions?
Phil
I provided a quote
citronas
Does this imply that the sessions won't get lost even if I switch from InProc _after_ the site's been online for a while?
Phil
If you are using InProc as SessionMode yes. With InProc it's simply not possible to keep the values - by design. For the desired behaviour you need to switch the SessionMode to SQLServer
citronas
Thank you for clarifying!
Phil