session variables being lost

Discussion in 'ASP .Net' started by Paul, Oct 1, 2008.

  1. Paul

    Paul Guest

    Hi I have a web application vs2005 and it looks like a condition is causing
    session veriables to be lost. This does not seem to be happening too often.
    The web application allows uploading and deleting files on the server, but
    not in the bin directory. I am not sure if this is related. Any idea what
    might be causing this and how to fix it?
    Thanks.
    --
    Paul G
    Software engineer.
     
    Paul, Oct 1, 2008
    #1
    1. Advertising

  2. Does it happen after a certain amount of time? Have you checked to make sure
    the application is not being recycled due to either 20 minutes of activity
    or perhaps the memory usage getting too high? What sort of things are you
    holding in session? You aren't storing large datasets or files in session
    are you? It could be that you're exceeding memory useage and the web server
    restarts the application in order to perform garbage collection and free up
    resources.

    Hope this helps,
    Mark Fitzpatrick

    "Paul" <> wrote in message
    news:...
    > Hi I have a web application vs2005 and it looks like a condition is
    > causing
    > session veriables to be lost. This does not seem to be happening too
    > often.
    > The web application allows uploading and deleting files on the server, but
    > not in the bin directory. I am not sure if this is related. Any idea
    > what
    > might be causing this and how to fix it?
    > Thanks.
    > --
    > Paul G
    > Software engineer.
     
    Mark Fitzpatrick, Oct 1, 2008
    #2
    1. Advertising

  3. Paul

    Paul Guest

    Thanks for the response, I do not think it is a session variable timing out
    but the memory issue might be worth investigating. There are several objects
    that get saved to session variables, will need to look at each one to see
    what is included as there were a few different authors that built the web
    application. I do not think we are saving any files to session state but
    will need to confirm this. Is there any easy way to tell if the memory is
    being exceeded, windows event log?

    --




    "Mark Fitzpatrick" wrote:

    > Does it happen after a certain amount of time? Have you checked to make sure
    > the application is not being recycled due to either 20 minutes of activity
    > or perhaps the memory usage getting too high? What sort of things are you
    > holding in session? You aren't storing large datasets or files in session
    > are you? It could be that you're exceeding memory useage and the web server
    > restarts the application in order to perform garbage collection and free up
    > resources.
    >
    > Hope this helps,
    > Mark Fitzpatrick
    >
    > "Paul" <> wrote in message
    > news:...
    > > Hi I have a web application vs2005 and it looks like a condition is
    > > causing
    > > session veriables to be lost. This does not seem to be happening too
    > > often.
    > > The web application allows uploading and deleting files on the server, but
    > > not in the bin directory. I am not sure if this is related. Any idea
    > > what
    > > might be causing this and how to fix it?
    > > Thanks.
    > > --
    > > Paul G
    > > Software engineer.

    >
    >
     
    Paul, Oct 1, 2008
    #3
  4. Paul

    sloan Guest

    I have not tried this, but think it would be interesting:

    http://weblogs.asp.net/scottgu/archive/2005/12/14/433194.aspx

    ScottGu is daBomb of course on this stuff.

    If you find a way to track the event, please post a followup here.



    "Paul" <> wrote in message
    news:...
    > Thanks for the response, I do not think it is a session variable timing
    > out
    > but the memory issue might be worth investigating. There are several
    > objects
    > that get saved to session variables, will need to look at each one to see
    > what is included as there were a few different authors that built the web
    > application. I do not think we are saving any files to session state but
    > will need to confirm this. Is there any easy way to tell if the memory is
    > being exceeded, windows event log?
    >
    > --
    >
    >
    >
    >
    > "Mark Fitzpatrick" wrote:
    >
    >> Does it happen after a certain amount of time? Have you checked to make
    >> sure
    >> the application is not being recycled due to either 20 minutes of
    >> activity
    >> or perhaps the memory usage getting too high? What sort of things are you
    >> holding in session? You aren't storing large datasets or files in session
    >> are you? It could be that you're exceeding memory useage and the web
    >> server
    >> restarts the application in order to perform garbage collection and free
    >> up
    >> resources.
    >>
    >> Hope this helps,
    >> Mark Fitzpatrick
    >>
    >> "Paul" <> wrote in message
    >> news:...
    >> > Hi I have a web application vs2005 and it looks like a condition is
    >> > causing
    >> > session veriables to be lost. This does not seem to be happening too
    >> > often.
    >> > The web application allows uploading and deleting files on the server,
    >> > but
    >> > not in the bin directory. I am not sure if this is related. Any idea
    >> > what
    >> > might be causing this and how to fix it?
    >> > Thanks.
    >> > --
    >> > Paul G
    >> > Software engineer.

    >>
    >>
     
    sloan, Oct 1, 2008
    #4
  5. Paul

    sloan Guest

    Here is another one:


    Quote
    //You can find out the reason for an application restart//
    http://odetocode.com/Blogs/scott/archive/2005/11/01/2402.aspx









    "sloan" <> wrote in message
    news:O51$r0%...
    >I have not tried this, but think it would be interesting:
    >
    > http://weblogs.asp.net/scottgu/archive/2005/12/14/433194.aspx
    >
    > ScottGu is daBomb of course on this stuff.
    >
    > If you find a way to track the event, please post a followup here.
    >
    >
    >
    > "Paul" <> wrote in message
    > news:...
    >> Thanks for the response, I do not think it is a session variable timing
    >> out
    >> but the memory issue might be worth investigating. There are several
    >> objects
    >> that get saved to session variables, will need to look at each one to see
    >> what is included as there were a few different authors that built the web
    >> application. I do not think we are saving any files to session state but
    >> will need to confirm this. Is there any easy way to tell if the memory
    >> is
    >> being exceeded, windows event log?
    >>
    >> --
    >>
    >>
    >>
    >>
    >> "Mark Fitzpatrick" wrote:
    >>
    >>> Does it happen after a certain amount of time? Have you checked to make
    >>> sure
    >>> the application is not being recycled due to either 20 minutes of
    >>> activity
    >>> or perhaps the memory usage getting too high? What sort of things are
    >>> you
    >>> holding in session? You aren't storing large datasets or files in
    >>> session
    >>> are you? It could be that you're exceeding memory useage and the web
    >>> server
    >>> restarts the application in order to perform garbage collection and free
    >>> up
    >>> resources.
    >>>
    >>> Hope this helps,
    >>> Mark Fitzpatrick
    >>>
    >>> "Paul" <> wrote in message
    >>> news:...
    >>> > Hi I have a web application vs2005 and it looks like a condition is
    >>> > causing
    >>> > session veriables to be lost. This does not seem to be happening too
    >>> > often.
    >>> > The web application allows uploading and deleting files on the server,
    >>> > but
    >>> > not in the bin directory. I am not sure if this is related. Any idea
    >>> > what
    >>> > might be causing this and how to fix it?
    >>> > Thanks.
    >>> > --
    >>> > Paul G
    >>> > Software engineer.
    >>>
    >>>

    >
    >
     
    sloan, Oct 1, 2008
    #5
  6. Paul

    Paul Guest

    Hi, not sure if the application is actually restarting although the session
    variables are being reset. The health monitor looks like it might be
    interesting to impliment!
    --
    Paul G
    Software engineer.


    "sloan" wrote:

    > I have not tried this, but think it would be interesting:
    >
    > http://weblogs.asp.net/scottgu/archive/2005/12/14/433194.aspx
    >
    > ScottGu is daBomb of course on this stuff.
    >
    > If you find a way to track the event, please post a followup here.
    >
    >
    >
    > "Paul" <> wrote in message
    > news:...
    > > Thanks for the response, I do not think it is a session variable timing
    > > out
    > > but the memory issue might be worth investigating. There are several
    > > objects
    > > that get saved to session variables, will need to look at each one to see
    > > what is included as there were a few different authors that built the web
    > > application. I do not think we are saving any files to session state but
    > > will need to confirm this. Is there any easy way to tell if the memory is
    > > being exceeded, windows event log?
    > >
    > > --
    > >
    > >
    > >
    > >
    > > "Mark Fitzpatrick" wrote:
    > >
    > >> Does it happen after a certain amount of time? Have you checked to make
    > >> sure
    > >> the application is not being recycled due to either 20 minutes of
    > >> activity
    > >> or perhaps the memory usage getting too high? What sort of things are you
    > >> holding in session? You aren't storing large datasets or files in session
    > >> are you? It could be that you're exceeding memory useage and the web
    > >> server
    > >> restarts the application in order to perform garbage collection and free
    > >> up
    > >> resources.
    > >>
    > >> Hope this helps,
    > >> Mark Fitzpatrick
    > >>
    > >> "Paul" <> wrote in message
    > >> news:...
    > >> > Hi I have a web application vs2005 and it looks like a condition is
    > >> > causing
    > >> > session veriables to be lost. This does not seem to be happening too
    > >> > often.
    > >> > The web application allows uploading and deleting files on the server,
    > >> > but
    > >> > not in the bin directory. I am not sure if this is related. Any idea
    > >> > what
    > >> > might be causing this and how to fix it?
    > >> > Thanks.
    > >> > --
    > >> > Paul G
    > >> > Software engineer.
    > >>
    > >>

    >
    >
    >
     
    Paul, Oct 1, 2008
    #6
  7. Paul

    bruce barker Guest

    if you upload to any folder other than appdata, then a recycle can be
    triggered.


    -- bruce (sqlwork.com)


    "Paul" wrote:

    > Hi I have a web application vs2005 and it looks like a condition is causing
    > session veriables to be lost. This does not seem to be happening too often.
    > The web application allows uploading and deleting files on the server, but
    > not in the bin directory. I am not sure if this is related. Any idea what
    > might be causing this and how to fix it?
    > Thanks.
    > --
    > Paul G
    > Software engineer.
     
    bruce barker, Oct 1, 2008
    #7
  8. Paul

    Paul Guest

    thanks for the information, wondering if this is something new in vs2005 and
    if there is a way to shut it off, were you can upload to any other folder
    (other than the bin) without loosing the current session variables?
    --
    Paul G
    Software engineer.


    "bruce barker" wrote:

    > if you upload to any folder other than appdata, then a recycle can be
    > triggered.
    >
    >
    > -- bruce (sqlwork.com)
    >
    >
    > "Paul" wrote:
    >
    > > Hi I have a web application vs2005 and it looks like a condition is causing
    > > session veriables to be lost. This does not seem to be happening too often.
    > > The web application allows uploading and deleting files on the server, but
    > > not in the bin directory. I am not sure if this is related. Any idea what
    > > might be causing this and how to fix it?
    > > Thanks.
    > > --
    > > Paul G
    > > Software engineer.
     
    Paul, Oct 1, 2008
    #8
  9. An application domain will unload (causing loss of session variables
    unless session state is maintained with State Server or SQL Server),
    when any one of the following occurs:

    a. Machine.Config, Web.Config or Global.asax are modified
    b. The bin directory or any of its contents is/are modified
    c. The App_Code directory contents changes
    d. The number of re-compilations (aspx, ascx or asax) exceeds the limit specified by the
    <compilation numRecompilesBeforeAppRestart=/> setting in machine.config or web.config
    (by default this is set to 15)
    e. The physical path of the virtual directory is modified
    f. The CAS policy is modified
    g. A web service is restarted
    h. (2.0 only) Application Sub-Directories are deleted
    i. Any of a number of configurable App Pool recycling reasons occurs


    This should cover most scenarios.



    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================

    "Paul" <> wrote in message news:...
    > thanks for the information, wondering if this is something new in vs2005 and
    > if there is a way to shut it off, were you can upload to any other folder
    > (other than the bin) without loosing the current session variables?
    > --
    > Paul G
    > Software engineer.
    >
    >
    > "bruce barker" wrote:
    >
    >> if you upload to any folder other than appdata, then a recycle can be
    >> triggered.
    >>
    >>
    >> -- bruce (sqlwork.com)
    >>
    >>
    >> "Paul" wrote:
    >>
    >> > Hi I have a web application vs2005 and it looks like a condition is causing
    >> > session veriables to be lost. This does not seem to be happening too often.
    >> > The web application allows uploading and deleting files on the server, but
    >> > not in the bin directory. I am not sure if this is related. Any idea what
    >> > might be causing this and how to fix it?
    >> > Thanks.
    >> > --
    >> > Paul G
    >> > Software engineer.
     
    Juan T. Llibre, Oct 2, 2008
    #9
  10. Paul

    Paul Guest

    thanks for the additional information, still not sure what is causing it but
    I wrote a small sample program and I am able to upload files to the root
    directory ok, but when I upload to the bin directory it looses the session
    variable, which corresponds to listing c provided. I am not sure what the
    CAS policy is, also not quite sure what listing i means?
    --
    Paul G
    Software engineer.


    "Juan T. Llibre" wrote:

    > An application domain will unload (causing loss of session variables
    > unless session state is maintained with State Server or SQL Server),
    > when any one of the following occurs:
    >
    > a. Machine.Config, Web.Config or Global.asax are modified
    > b. The bin directory or any of its contents is/are modified
    > c. The App_Code directory contents changes
    > d. The number of re-compilations (aspx, ascx or asax) exceeds the limit specified by the
    > <compilation numRecompilesBeforeAppRestart=/> setting in machine.config or web.config
    > (by default this is set to 15)
    > e. The physical path of the virtual directory is modified
    > f. The CAS policy is modified
    > g. A web service is restarted
    > h. (2.0 only) Application Sub-Directories are deleted
    > i. Any of a number of configurable App Pool recycling reasons occurs
    >
    >
    > This should cover most scenarios.
    >
    >
    >
    > Juan T. Llibre, asp.net MVP
    > asp.net faq : http://asp.net.do/faq/
    > foros de asp.net, en español : http://asp.net.do/foros/
    > ======================================
    >
    > "Paul" <> wrote in message news:...
    > > thanks for the information, wondering if this is something new in vs2005 and
    > > if there is a way to shut it off, were you can upload to any other folder
    > > (other than the bin) without loosing the current session variables?
    > > --
    > > Paul G
    > > Software engineer.
    > >
    > >
    > > "bruce barker" wrote:
    > >
    > >> if you upload to any folder other than appdata, then a recycle can be
    > >> triggered.
    > >>
    > >>
    > >> -- bruce (sqlwork.com)
    > >>
    > >>
    > >> "Paul" wrote:
    > >>
    > >> > Hi I have a web application vs2005 and it looks like a condition is causing
    > >> > session veriables to be lost. This does not seem to be happening too often.
    > >> > The web application allows uploading and deleting files on the server, but
    > >> > not in the bin directory. I am not sure if this is related. Any idea what
    > >> > might be causing this and how to fix it?
    > >> > Thanks.
    > >> > --
    > >> > Paul G
    > >> > Software engineer.

    >
    >
    >
     
    Paul, Oct 2, 2008
    #10
  11. Hi, Paul.

    re:
    !> I am not sure what the CAS policy is

    CAS is the Code Access Security configuration

    General info:
    http://msdn.microsoft.com/en-us/library/930b76w0.aspx

    If you create any custom Code Access Security permissions, per the instructions at:
    http://msdn.microsoft.com/en-us/library/yctbsyf4.aspx

    ....as soon as the custom permissions are implemented, the AppDomain will unload/restart,
    causing the loss of session variables, unless you don't use in-process state management,
    i.e., unless you use SQL Server or State Server to manage state in your application.

    re:
    !> also not quite sure what listing i means?

    Whenever you change any configurable reason for an Application Pool to recycle,
    that will cause an automatic Application Pool recycle, with the same events
    described above occurring.

    You can configure Application Pools with the IIS Manager.

    Open the IIS Manager, scroll down on the left panel to "Application Pools",
    right click the desired Application Pool, select "Properties" and configure to your needs.

    Be careful and know what you are doing before changing that stuff, though.
    You can seriously harm your Application and server's performance if you misconfigure an App Pool.

    More info on Application Pool specific configuration parameters:

    http://www.microsoft.com/technet/pr...IIS/1652e79e-21f9-4e89-bc4b-c13f894a0cfe.mspx

    An extremely good tutorial on Ensuring Application Availability :
    http://www.microsoft.com/technet/pr...IIS/1652e79e-21f9-4e89-bc4b-c13f894a0cfe.mspx

    On this last page, open the fly-ou menu on the left,
    and make sure you read through every single page.

    It will be one of the best investments you can make in regard to learning
    how to configure your applications for top availability and performance.




    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    "Paul" <> wrote in message news:...
    > thanks for the additional information, still not sure what is causing it but
    > I wrote a small sample program and I am able to upload files to the root
    > directory ok, but when I upload to the bin directory it looses the session
    > variable, which corresponds to listing c provided. I am not sure what the
    > CAS policy is, also not quite sure what listing i means?
    > --
    > Paul G
    > Software engineer.
    >
    >
    > "Juan T. Llibre" wrote:
    >
    >> An application domain will unload (causing loss of session variables
    >> unless session state is maintained with State Server or SQL Server),
    >> when any one of the following occurs:
    >>
    >> a. Machine.Config, Web.Config or Global.asax are modified
    >> b. The bin directory or any of its contents is/are modified
    >> c. The App_Code directory contents changes
    >> d. The number of re-compilations (aspx, ascx or asax) exceeds the limit specified by the
    >> <compilation numRecompilesBeforeAppRestart=/> setting in machine.config or web.config
    >> (by default this is set to 15)
    >> e. The physical path of the virtual directory is modified
    >> f. The CAS policy is modified
    >> g. A web service is restarted
    >> h. (2.0 only) Application Sub-Directories are deleted
    >> i. Any of a number of configurable App Pool recycling reasons occurs
    >>
    >>
    >> This should cover most scenarios.
    >>
    >>
    >>
    >> Juan T. Llibre, asp.net MVP
    >> asp.net faq : http://asp.net.do/faq/
    >> foros de asp.net, en español : http://asp.net.do/foros/
    >> ======================================
    >>
    >> "Paul" <> wrote in message news:...
    >> > thanks for the information, wondering if this is something new in vs2005 and
    >> > if there is a way to shut it off, were you can upload to any other folder
    >> > (other than the bin) without loosing the current session variables?
    >> > --
    >> > Paul G
    >> > Software engineer.
    >> >
    >> >
    >> > "bruce barker" wrote:
    >> >
    >> >> if you upload to any folder other than appdata, then a recycle can be
    >> >> triggered.
    >> >>
    >> >>
    >> >> -- bruce (sqlwork.com)
    >> >>
    >> >>
    >> >> "Paul" wrote:
    >> >>
    >> >> > Hi I have a web application vs2005 and it looks like a condition is causing
    >> >> > session veriables to be lost. This does not seem to be happening too often.
    >> >> > The web application allows uploading and deleting files on the server, but
    >> >> > not in the bin directory. I am not sure if this is related. Any idea what
    >> >> > might be causing this and how to fix it?
    >> >> > Thanks.
    >> >> > --
    >> >> > Paul G
    >> >> > Software engineer.

    >>
    >>
    >>
     
    Juan T. Llibre, Oct 3, 2008
    #11
  12. Paul

    Hans Kesting Guest

    Paul wrote :
    > but when I upload to the bin directory it looses the session
    > variable,
    >
    > "Juan T. Llibre" wrote:
    >
    >> b. The bin directory or any of its contents is/are modified


    There's your reason...

    Hans Kesting
     
    Hans Kesting, Oct 3, 2008
    #12
    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. Jacob Anderson

    Session state being lost

    Jacob Anderson, Oct 27, 2003, in forum: ASP .Net
    Replies:
    8
    Views:
    2,556
    Jacob Anderson
    Oct 30, 2003
  2. gupta
    Replies:
    1
    Views:
    674
  3. Eliyahu Goldin

    Lost session variables - size issue?

    Eliyahu Goldin, Jan 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    372
    Chris Botha
    Jan 14, 2004
  4. =?Utf-8?B?TWljaGFlbCBTTA==?=

    RE: Lost Session Variables

    =?Utf-8?B?TWljaGFlbCBTTA==?=, Feb 25, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    438
    =?Utf-8?B?TWljaGFlbCBTTA==?=
    Feb 26, 2004
  5. =?Utf-8?B?U2FyYWggTWFycmlvdHQ=?=

    Session variable data being lost

    =?Utf-8?B?U2FyYWggTWFycmlvdHQ=?=, Apr 18, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    895
    Walter
    Oct 5, 2007
Loading...

Share This Page