views:

50

answers:

2

When deploying a web project written in ASP.Net, what happens to user sessions? Do users currently logged in lose their session data?

And moreover, does the Web Application Project in Visual Studio differ from the Web Site Project in this respect?

+1  A: 

Whenever you deploy an ASP.NET application to a live server you are at risk of losing current users sessions.

If you are deploying the binaries or the config files then absolutely the application will restart resulting in all sessions being dropped.

Even if you are not deploying binaries of configs, if you make "too many" (defined in machine.config) changes to the aspx pages themselves then you are also at risk of the application restarting.

Robin Day
+3  A: 

It depends. If Session state mode is defined as "inproc" it will clear all sessions when updating a dll or changing a config file.

On the other 2 modes you will not lose session values.

WebApplications and WebSites work the same way.

Moe info here: http://msdn.microsoft.com/en-us/library/ms972429.aspx

Sergio
+1, I was going to add the descriptions of alternative state mode but figured it was too much for the question being asked.
Robin Day