WEB.Config issue!!!

Discussion in 'ASP .Net' started by =?Utf-8?B?TWFoZXNo?=, Mar 15, 2005.

  1. 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....
    =?Utf-8?B?TWFoZXNo?=, Mar 15, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?TWFoZXNo?=

    Guest

    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)
    , Mar 15, 2005
    #2
    1. Advertising

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

    "Mahesh" <> wrote in message
    news:...
    > 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....
    Peter Rilling, Mar 15, 2005
    #3
  4. =?Utf-8?B?TWFoZXNo?=

    Brock Allen Guest

    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.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > 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....
    >
    Brock Allen, Mar 15, 2005
    #4
  5. =?Utf-8?B?TWFoZXNo?=

    Brock Allen Guest

    > 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.


    And, BTW, this is done in web.config under the <sessionState> element:

    http://msdn.microsoft.com/library/d...us/cpgenref/html/gngrfsessionstatesection.asp

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen
    Brock Allen, Mar 15, 2005
    #5
  6. =?Utf-8?B?TWFoZXNo?=

    jongalloway Guest

    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
    jongalloway, Mar 15, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGFuaWVs?=

    Machine.config & web.config

    =?Utf-8?B?RGFuaWVs?=, Jan 18, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    13,304
    Hermit Dave
    Jan 18, 2004
  2. =?Utf-8?B?QXVndXN0aW4gUHJhc2FubmEuIEo=?=

    Web.Config Get Config settings at runtime.

    =?Utf-8?B?QXVndXN0aW4gUHJhc2FubmEuIEo=?=, Feb 5, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,257
    Kevin Spencer
    Feb 6, 2004
  3. Benny Ng
    Replies:
    9
    Views:
    9,953
    Benny Ng
    Oct 13, 2005
  4. =?Utf-8?B?TSBPIEogTw==?=

    web.config and "copy web site" issue

    =?Utf-8?B?TSBPIEogTw==?=, Feb 21, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    487
    Scott Allen
    Feb 21, 2006
  5. CSharpner
    Replies:
    0
    Views:
    1,017
    CSharpner
    Apr 9, 2007
Loading...

Share This Page