views:

91

answers:

1

Using VS2008sp1: trying to find a reliable way (or proper way) to update a running web application (ASP.NET 3.5sp1) without losing current user sessions/context.

I know users can get a busy message during the publish which is ok. Question is: does IIS reset sessions? or lose any context that the current users are in? Can this be phased in? or can I adjust my architecture to help this.

My only current solution now is to do it 'after' hours, but once its 24x7 - when is that? ;)

+5  A: 

Whenever you update the web application the app domain is terminated and a new one is started, so unless you are storing user state elsewhere, your users will lose their session state.

A couple of ways you can fix this are:

  1. Store user session out of process (could be a database). As long as this state is persisted somewhere, you can restore the user's state from the web app itself when the app comes back up.

  2. Don't store state/session values anywhere other than perhaps a cookie or a querystring. That way no state is lost when the app is restarted.

TskTsk