Everytime we publish our .NET app on Azure, all users are bein logged off and to sign in again, what our users won't understand. The user sessions are implemented using the SimpleMembership provider.
Is there any way to keep user sessions alive, even after we update our app?
I think you have misunderstood what publishing does. When you publish the application it will create a new instance of the w3wp.exe
process. This is the web process where the application memory is stored (keeping it simple). If you publish you are creating a new instance and the old is getting destroyed.
All sessions will be lost.
For example, every time you publish the website, it will make a change to web.config
. This will cause the application to unload and IIS to recycle.
Causes:
Web.config
Changes bin folder
content change IIS
applicaiton pool recycleIf you need to keep your sessions alive then you should look at Session-State Modes