Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET deployment: How to avoid losing session state when updating code?

How do you work-around the fact that sessions are dropped every time you deploy certain code files to an ASP.NET website? Sometimes we need to deploy a crucial fix in the middle of the day but don't want to boot off all our users for it.

like image 651
Matias Nino Avatar asked Jan 08 '10 20:01

Matias Nino


2 Answers

By default Sessions are stored InProc. You should choose an out-of-process option.

Maybe just a StateServer is enough in your scenario

like image 82
Rubens Farias Avatar answered Nov 03 '22 01:11

Rubens Farias


One way would be to have a load-balanced server set-up. You could direct all traffic to server A, patch Server B and then repeat the other way around.

Alternatively, as @Curtisk states, better to get to the stage where you don't need to do "hot patches" through rigourous testing and then proceed to planned outages advertised in advance.

Hope this helps.

like image 26
Paul Suart Avatar answered Nov 03 '22 01:11

Paul Suart