WEB.Config issue!!!

G

Guest

Hi All,

I noticed in my wb app whenever I modify my web.config the existing sessions
are getting dropped.

I cant understand why this is happening....
 
R

recoil

The Web Application is restarted whenever a change is made to
web.config i believe.

I believe this means that any information that is stored in Sessions,
Application or Cache is discarded.

If you note events for Session/Application End and Start are probably
are triggered.

Also important to note that any information in the Session or
Application should be deemd unimportant as it can be lost at a moment's
notice. This means that you should have alternate methods of storage
and identifying which information belongs to a session or an
application (depending upon how important the information is)
 
P

Peter Rilling

ASP.NET gets reloaded when the config file changes. That might cause it to
release all memory.
 
B

Brock Allen

Your session state by default is being maintained InProc (in memory in the
web application). Once your settings in web.config changes, your running
web applicaiton is no longer consistent with the config settings, so ASP.NET
shuts it down and brings up a new on to replace it (with the current settings).
So, when it shuts down your in memory state (like session state) is lost.

Consider 1) not using session state at all. There are many ways to build
an app, maintain state and not store it in session state. Or 2) Configure
session state to use the StateServer NT Service, which is an out of process
app that holds session state such that the state will survive a application
restart. You can also store this data in SqlServer, but for your needs, I
imagine the StateServer Service is sufficient.
 
B

Brock Allen

J

jongalloway

Editing your web.config file causes an application restart so ASP.NET
can load the site with your new web.config settings. If you're using
InProc session state, that means your sessions get dropped.

You can move your session state to either the State Server or SQL
Server, which will maintain session information through an application
restart. More information on that here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconsessionstate.asp

Your webserver respond slowly on the first page hit after you've edited
the web.config file, since ASP.NET needs to JIT compile your code. It's
a good idea to browse to the site yourself immediately after editing
web.config to trigger this.

- Jon
http://weblogs.asp.net/jgalloway
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top