|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Session State stateserver or Sql Serverhave been loosing my information after a period of time (normally 20 minutes). Is there anyway to find out how much more time I have on a session? If I do a refresh, does reset the session clock? Do you have have to go to another page to reset the session timeout or will a postback also do it? This is important as we have a few pages that a user will stay on where he will be doing all kinds of submits that will just do Postbacks (so the page doesn't change). This could be a problem if all of a sudden the timeout period comes up and the user has not left the page. All of a sudden, I get an error that says the session variable is blank. I am thinking of switching ot State Server or Sql Server mode, but am not sure of the drawbacks. Most of the books give a small idea of the different modes but not much on the pros and cons. One question is - does my code still work the same as far as setting and reading session variables? Thanks, Tom tshad wrote:
Show quoteHide quote > I have been using the default session state (InProc) and have found that I Any requests cause the Session to reset its counter; i.e. it is a > have been loosing my information after a period of time (normally 20 > minutes). > > Is there anyway to find out how much more time I have on a session? > > If I do a refresh, does reset the session clock? > > Do you have have to go to another page to reset the session timeout or will > a postback also do it? This is important as we have a few pages that a user > will stay on where he will be doing all kinds of submits that will just do > Postbacks (so the page doesn't change). This could be a problem if all of a > sudden the timeout period comes up and the user has not left the page. All > of a sudden, I get an error that says the session variable is blank. > > I am thinking of switching ot State Server or Sql Server mode, but am not > sure of the drawbacks. Most of the books give a small idea of the different > modes but not much on the pros and cons. > > One question is - does my code still work the same as far as setting and > reading session variables? > > Thanks, > > Tom > > sliding expiration. If you wanted to know the amount of time left (for some reason after knowing it does reset its timer), you'd have to set your own Session variable to hold the current time, set it when done processing and response is set to client. Then you'd have to do the math on the next request....but not much use to me, unless you want to know how close you came to timing out... SqlServer and StateServer are useful for when you want to persist the session across webserver restarts; it stores the Session info on another server (or out of process). There's no discernible difference in how you would call variables themselves... -- Craig Deelsnyder Microsoft MVP - ASP/ASP.NET
Show quote
Hide quote
"Craig Deelsnyder" <cdeelsny@NO_SPAM_4_MEyahoo.com> wrote in message Well, that would make sense except that I am in development mode and amnews:eIgX9GWbFHA.2288@TK2MSFTNGP14.phx.gbl... > tshad wrote: > > I have been using the default session state (InProc) and have found that I > > have been loosing my information after a period of time (normally 20 > > minutes). > > > > Is there anyway to find out how much more time I have on a session? > > > > If I do a refresh, does reset the session clock? > > > > Do you have have to go to another page to reset the session timeout or will > > a postback also do it? This is important as we have a few pages that a user > > will stay on where he will be doing all kinds of submits that will just do > > Postbacks (so the page doesn't change). This could be a problem if all of a > > sudden the timeout period comes up and the user has not left the page. All > > of a sudden, I get an error that says the session variable is blank. > > > > I am thinking of switching ot State Server or Sql Server mode, but am not > > sure of the drawbacks. Most of the books give a small idea of the different > > modes but not much on the pros and cons. > > > > One question is - does my code still work the same as far as setting and > > reading session variables? > > > > Thanks, > > > > Tom > > > > > > Any requests cause the Session to reset its counter; i.e. it is a > sliding expiration. working on a page at a time and making many changes. Then I usually just do a refresh or go back a page and hit one of my buttons to rerun the page. I am doing this every couple of minutes or so. But after about 15-20 minutes the session variables are gone. If each request would reset the counter, why am I losing my session variables? >If you wanted to know the amount of time left (for Mainly for testing purposes.> some reason after knowing it does reset its timer), you'd have to set > your own Session variable to hold the current time, set it when done > processing and response is set to client. Then you'd have to do the > math on the next request....but not much use to me, unless you want to > know how close you came to timing out... > Does this include the worker process recycles? Or does it not do these> SqlServer and StateServer are useful for when you want to persist the > session across webserver restarts; recycles in these modes? Tom Show quoteHide quote >it stores the Session info on another > server (or out of process). There's no discernible difference in how > you would call variables themselves... > > -- > Craig Deelsnyder > Microsoft MVP - ASP/ASP.NET StateServer on a single box or a web farm with session affinity
will get rid of your periodic session loss with InProc. Read these, they'll be helpful ASP.NET Session FAQ http://www.eggheadcafe.com/articles/20021016.asp More info on how StateServer might help http://www.eggheadcafe.com/articles/20030416.asp Optional software to better manage InProc session state outside of ASP.NET in a web farm. http://www.eggheadcafe.com/articles/scaleout_server.asp -- Show quoteHide quote2004 and 2005 Microsoft MVP C# Robbe Morris http://www.masterado.net Earn $$$ money answering .NET Framework messageboard posts at EggHeadCafe.com. http://www.eggheadcafe.com/forums/merit.asp "tshad" <tscheider***@ftsolutions.com> wrote in message news:OQZ3t8UbFHA.2796@TK2MSFTNGP10.phx.gbl... >I have been using the default session state (InProc) and have found that I >have been loosing my information after a period of time (normally 20 >minutes). > > Is there anyway to find out how much more time I have on a session? > > If I do a refresh, does reset the session clock? > > Do you have have to go to another page to reset the session timeout or > will a postback also do it? This is important as we have a few pages that > a user will stay on where he will be doing all kinds of submits that will > just do Postbacks (so the page doesn't change). This could be a problem > if all of a sudden the timeout period comes up and the user has not left > the page. All of a sudden, I get an error that says the session variable > is blank. > > I am thinking of switching ot State Server or Sql Server mode, but am not > sure of the drawbacks. Most of the books give a small idea of the > different modes but not much on the pros and cons. > > One question is - does my code still work the same as far as setting and > reading session variables? > > Thanks, > > Tom > "Robbe Morris [C# MVP]" <i***@eggheadcafe.com> wrote in message That answered a lot of questions ad I have already changed to "stateServer"news:uBMd2GWbFHA.2184@TK2MSFTNGP15.phx.gbl... > StateServer on a single box or a web farm with session affinity > will get rid of your periodic session loss with InProc. > > Read these, they'll be helpful > > ASP.NET Session FAQ > > http://www.eggheadcafe.com/articles/20021016.asp mode and it seems to work fine. I will test it out more tomorrow. One question that I have is if I am using stateServer, does the "worker process recycles" still happen? If so, how does this affect my session? The articles say that you don't lose the session variables during the recycles. Also, if you the session times out (but you don't lose your sessionID - which is what the articles said until the browser closes), do you lose your session variables at this time when using "stateServer" mode? Thanks, Tom Show quoteHide quote > > More info on how StateServer might help > > http://www.eggheadcafe.com/articles/20030416.asp > > Optional software to better manage InProc > session state outside of ASP.NET in a web farm. > > http://www.eggheadcafe.com/articles/scaleout_server.asp > > -- > 2004 and 2005 Microsoft MVP C# > Robbe Morris > http://www.masterado.net > > Earn $$$ money answering .NET Framework > messageboard posts at EggHeadCafe.com. > http://www.eggheadcafe.com/forums/merit.asp > > > > "tshad" <tscheider***@ftsolutions.com> wrote in message > news:OQZ3t8UbFHA.2796@TK2MSFTNGP10.phx.gbl... > >I have been using the default session state (InProc) and have found that I > >have been loosing my information after a period of time (normally 20 > >minutes). > > > > Is there anyway to find out how much more time I have on a session? > > > > If I do a refresh, does reset the session clock? > > > > Do you have have to go to another page to reset the session timeout or > > will a postback also do it? This is important as we have a few pages that > > a user will stay on where he will be doing all kinds of submits that will > > just do Postbacks (so the page doesn't change). This could be a problem > > if all of a sudden the timeout period comes up and the user has not left > > the page. All of a sudden, I get an error that says the session variable > > is blank. > > > > I am thinking of switching ot State Server or Sql Server mode, but am not > > sure of the drawbacks. Most of the books give a small idea of the > > different modes but not much on the pros and cons. > > > > One question is - does my code still work the same as far as setting and > > reading session variables? > > > > Thanks, > > > > Tom > > > > Hi, Tshad.
I see you've made some progress since the suggestion to switch to State Server. Congratulations! re: > One question that I have is if I am using stateServer, Yes, they do.> does the "worker process recycles" still happen? All ASP.NET worker processes you may have running will get recycled depending on the way you configure them. State Server runs in a *different* process which doesn't get recycled until you reboot the computer where the application is running, and that's why the session variables aren't lost when the ASP.NET worker process is recycled. The two processes have independent lives, although they work together. re: >If so, how does this affect my session? Your session variables continue to exist until the session times outor until the box is rebooted. Juan T. Llibre ASP.NET MVP http://asp.net.do/foros/ Foros de ASP.NET en Español Ven, y hablemos de ASP.NET... ====================== Show quoteHide quote "tshad" <t**@dslextreme.com> wrote in message news:%23Fjpl1XbFHA.3712@TK2MSFTNGP09.phx.gbl... > "Robbe Morris [C# MVP]" <i***@eggheadcafe.com> wrote in message > news:uBMd2GWbFHA.2184@TK2MSFTNGP15.phx.gbl... >> StateServer on a single box or a web farm with session affinity >> will get rid of your periodic session loss with InProc. >> >> Read these, they'll be helpful >> >> ASP.NET Session FAQ >> >> http://www.eggheadcafe.com/articles/20021016.asp > > That answered a lot of questions ad I have already changed to "stateServer" > mode and it seems to work fine. I will test it out more tomorrow. > > One question that I have is if I am using stateServer, does the "worker > process recycles" still happen? If so, how does this affect my session? > The articles say that you don't lose the session variables during the > recycles. > > Also, if you the session times out (but you don't lose your sessionID - > which is what the articles said until the browser closes), do you lose your > session variables at this time when using "stateServer" mode? > > Thanks, > > Tom > >> >> More info on how StateServer might help >> >> http://www.eggheadcafe.com/articles/20030416.asp >> >> Optional software to better manage InProc >> session state outside of ASP.NET in a web farm. >> >> http://www.eggheadcafe.com/articles/scaleout_server.asp >> >> -- >> 2004 and 2005 Microsoft MVP C# >> Robbe Morris >> http://www.masterado.net >> >> Earn $$$ money answering .NET Framework >> messageboard posts at EggHeadCafe.com. >> http://www.eggheadcafe.com/forums/merit.asp >> >> >> >> "tshad" <tscheider***@ftsolutions.com> wrote in message >> news:OQZ3t8UbFHA.2796@TK2MSFTNGP10.phx.gbl... >> >I have been using the default session state (InProc) and have found that > I >> >have been loosing my information after a period of time (normally 20 >> >minutes). >> > >> > Is there anyway to find out how much more time I have on a session? >> > >> > If I do a refresh, does reset the session clock? >> > >> > Do you have have to go to another page to reset the session timeout or >> > will a postback also do it? This is important as we have a few pages > that >> > a user will stay on where he will be doing all kinds of submits that > will >> > just do Postbacks (so the page doesn't change). This could be a problem >> > if all of a sudden the timeout period comes up and the user has not left >> > the page. All of a sudden, I get an error that says the session > variable >> > is blank. >> > >> > I am thinking of switching ot State Server or Sql Server mode, but am > not >> > sure of the drawbacks. Most of the books give a small idea of the >> > different modes but not much on the pros and cons. >> > >> > One question is - does my code still work the same as far as setting and >> > reading session variables? >> > >> > Thanks, >> > >> > Tom >> > >> >> > > "Juan T. Llibre" <nomailrepl***@nowhere.com> wrote in message Thanks - I will be checking it out today, but it seems to have solved the news:OhAgovabFHA.2696@TK2MSFTNGP09.phx.gbl... > Hi, Tshad. > > I see you've made some progress since the suggestion > to switch to State Server. Congratulations! problem. > But what do they do?> re: >> One question that I have is if I am using stateServer, >> does the "worker process recycles" still happen? > > Yes, they do. > If the worker process recycles at a different time then the session timeouts - what is it doing and what is the point if the session is still live? > All ASP.NET worker processes you may have running Are you talking about the Application Pools Properties?> will get recycled depending on the way you configure them. There are various properties there that I am not sure what to do with. The only thing on the Recycle tab that I have checked is "Recycle work processes (in minutes)" and it is set to 1740. That is 29 hours - this obviously was not what was clearing my session variables. None of the others (Number of requests, specific time, memory) are checked. I assume that the Idle timeout might have been cause it (but it doesn't say recycle - it says shutdown the process. Would this clear the session variables? If this is supposed to release the resources - wouldn't this cause the session a problem, even if the session variables are there? > Wait.> State Server runs in a *different* process which doesn't get recycled > until you reboot the computer where the application is running, > and that's why the session variables aren't lost when the ASP.NET > worker process is recycled. > I thought the session still gets recycled if in StateServer mode - you just don't lose the session variables. > The two processes have independent lives, although they work together. But if the recycling happens and you lose your resources - how does the > > re: >>If so, how does this affect my session? > > Your session variables continue to exist until the session times out > or until the box is rebooted. > session still work? Tom Show quoteHide quote > > > > Juan T. Llibre > ASP.NET MVP > http://asp.net.do/foros/ > Foros de ASP.NET en Español > Ven, y hablemos de ASP.NET... > ====================== > > "tshad" <t**@dslextreme.com> wrote in message > news:%23Fjpl1XbFHA.3712@TK2MSFTNGP09.phx.gbl... >> "Robbe Morris [C# MVP]" <i***@eggheadcafe.com> wrote in message >> news:uBMd2GWbFHA.2184@TK2MSFTNGP15.phx.gbl... >>> StateServer on a single box or a web farm with session affinity >>> will get rid of your periodic session loss with InProc. >>> >>> Read these, they'll be helpful >>> >>> ASP.NET Session FAQ >>> >>> http://www.eggheadcafe.com/articles/20021016.asp >> >> That answered a lot of questions ad I have already changed to >> "stateServer" >> mode and it seems to work fine. I will test it out more tomorrow. >> >> One question that I have is if I am using stateServer, does the "worker >> process recycles" still happen? If so, how does this affect my session? >> The articles say that you don't lose the session variables during the >> recycles. >> >> Also, if you the session times out (but you don't lose your sessionID - >> which is what the articles said until the browser closes), do you lose >> your >> session variables at this time when using "stateServer" mode? >> >> Thanks, >> >> Tom >> >>> >>> More info on how StateServer might help >>> >>> http://www.eggheadcafe.com/articles/20030416.asp >>> >>> Optional software to better manage InProc >>> session state outside of ASP.NET in a web farm. >>> >>> http://www.eggheadcafe.com/articles/scaleout_server.asp >>> >>> -- >>> 2004 and 2005 Microsoft MVP C# >>> Robbe Morris >>> http://www.masterado.net >>> >>> Earn $$$ money answering .NET Framework >>> messageboard posts at EggHeadCafe.com. >>> http://www.eggheadcafe.com/forums/merit.asp >>> >>> >>> >>> "tshad" <tscheider***@ftsolutions.com> wrote in message >>> news:OQZ3t8UbFHA.2796@TK2MSFTNGP10.phx.gbl... >>> >I have been using the default session state (InProc) and have found >>> >that >> I >>> >have been loosing my information after a period of time (normally 20 >>> >minutes). >>> > >>> > Is there anyway to find out how much more time I have on a session? >>> > >>> > If I do a refresh, does reset the session clock? >>> > >>> > Do you have have to go to another page to reset the session timeout or >>> > will a postback also do it? This is important as we have a few pages >> that >>> > a user will stay on where he will be doing all kinds of submits that >> will >>> > just do Postbacks (so the page doesn't change). This could be a >>> > problem >>> > if all of a sudden the timeout period comes up and the user has not >>> > left >>> > the page. All of a sudden, I get an error that says the session >> variable >>> > is blank. >>> > >>> > I am thinking of switching ot State Server or Sql Server mode, but am >> not >>> > sure of the drawbacks. Most of the books give a small idea of the >>> > different modes but not much on the pros and cons. >>> > >>> > One question is - does my code still work the same as far as setting >>> > and >>> > reading session variables? >>> > >>> > Thanks, >>> > >>> > Tom >>> > >>> >>> >> >> > > There's a lot of questions in your post,
but only is really critical, so I'll address it. re: > I thought the session still gets recycled if in StateServer mode - you just don't lose The session doen't get recycled when you use State Server.> the session variables. The *ASP.NET worker process* gets recycled. The whole purpose of using State Server is to store the session variables in a Windows service ( the State Server ) which does *not* recycle when the ASP.NET worker process recycles, which means that your session variables ( stored in the State Server) don't get lost. I hope that makes those concepts clearer. Juan T. Llibre ASP.NET MVP http://asp.net.do/foros/ Foros de ASP.NET en Español Ven, y hablemos de ASP.NET... ====================== Show quoteHide quote "tshad" <tscheider***@ftsolutions.com> wrote in message news:eciRe7cbFHA.612@TK2MSFTNGP12.phx.gbl... > "Juan T. Llibre" <nomailrepl***@nowhere.com> wrote in message > news:OhAgovabFHA.2696@TK2MSFTNGP09.phx.gbl... >> Hi, Tshad. >> >> I see you've made some progress since the suggestion >> to switch to State Server. Congratulations! > > Thanks - I will be checking it out today, but it seems to have solved the problem. >> >> re: >>> One question that I have is if I am using stateServer, >>> does the "worker process recycles" still happen? >> >> Yes, they do. >> > > But what do they do? > > If the worker process recycles at a different time then the session timeouts - what is > it doing and what is the point if the session is still live? > >> All ASP.NET worker processes you may have running >> will get recycled depending on the way you configure them. > > Are you talking about the Application Pools Properties? > > There are various properties there that I am not sure what to do with. > > The only thing on the Recycle tab that I have checked is "Recycle work processes (in > minutes)" and it is set to 1740. That is 29 hours - this obviously was not what was > clearing my session variables. None of the others (Number of requests, specific time, > memory) are checked. > > I assume that the Idle timeout might have been cause it (but it doesn't say recycle - it > says shutdown the process. Would this clear the session variables? > > If this is supposed to release the resources - wouldn't this cause the session a > problem, even if the session variables are there? >> >> State Server runs in a *different* process which doesn't get recycled >> until you reboot the computer where the application is running, >> and that's why the session variables aren't lost when the ASP.NET >> worker process is recycled. >> > > Wait. > > I thought the session still gets recycled if in StateServer mode - you just don't lose > the session variables. > >> The two processes have independent lives, although they work together. >> >> re: >>>If so, how does this affect my session? >> >> Your session variables continue to exist until the session times out >> or until the box is rebooted. >> > > But if the recycling happens and you lose your resources - how does the session still > work? > > Tom >> >> >> >> Juan T. Llibre >> ASP.NET MVP >> http://asp.net.do/foros/ >> Foros de ASP.NET en Español >> Ven, y hablemos de ASP.NET... >> ====================== >> >> "tshad" <t**@dslextreme.com> wrote in message >> news:%23Fjpl1XbFHA.3712@TK2MSFTNGP09.phx.gbl... >>> "Robbe Morris [C# MVP]" <i***@eggheadcafe.com> wrote in message >>> news:uBMd2GWbFHA.2184@TK2MSFTNGP15.phx.gbl... >>>> StateServer on a single box or a web farm with session affinity >>>> will get rid of your periodic session loss with InProc. >>>> >>>> Read these, they'll be helpful >>>> >>>> ASP.NET Session FAQ >>>> >>>> http://www.eggheadcafe.com/articles/20021016.asp >>> >>> That answered a lot of questions ad I have already changed to "stateServer" >>> mode and it seems to work fine. I will test it out more tomorrow. >>> >>> One question that I have is if I am using stateServer, does the "worker >>> process recycles" still happen? If so, how does this affect my session? >>> The articles say that you don't lose the session variables during the >>> recycles. >>> >>> Also, if you the session times out (but you don't lose your sessionID - >>> which is what the articles said until the browser closes), do you lose your >>> session variables at this time when using "stateServer" mode? >>> >>> Thanks, >>> >>> Tom >>> >>>> >>>> More info on how StateServer might help >>>> >>>> http://www.eggheadcafe.com/articles/20030416.asp >>>> >>>> Optional software to better manage InProc >>>> session state outside of ASP.NET in a web farm. >>>> >>>> http://www.eggheadcafe.com/articles/scaleout_server.asp >>>> >>>> -- >>>> 2004 and 2005 Microsoft MVP C# >>>> Robbe Morris >>>> http://www.masterado.net >>>> >>>> Earn $$$ money answering .NET Framework >>>> messageboard posts at EggHeadCafe.com. >>>> http://www.eggheadcafe.com/forums/merit.asp >>>> >>>> >>>> >>>> "tshad" <tscheider***@ftsolutions.com> wrote in message >>>> news:OQZ3t8UbFHA.2796@TK2MSFTNGP10.phx.gbl... >>>> >I have been using the default session state (InProc) and have found that >>> I >>>> >have been loosing my information after a period of time (normally 20 >>>> >minutes). >>>> > >>>> > Is there anyway to find out how much more time I have on a session? >>>> > >>>> > If I do a refresh, does reset the session clock? >>>> > >>>> > Do you have have to go to another page to reset the session timeout or >>>> > will a postback also do it? This is important as we have a few pages >>> that >>>> > a user will stay on where he will be doing all kinds of submits that >>> will >>>> > just do Postbacks (so the page doesn't change). This could be a problem >>>> > if all of a sudden the timeout period comes up and the user has not left >>>> > the page. All of a sudden, I get an error that says the session >>> variable >>>> > is blank. >>>> > >>>> > I am thinking of switching ot State Server or Sql Server mode, but am >>> not >>>> > sure of the drawbacks. Most of the books give a small idea of the >>>> > different modes but not much on the pros and cons. >>>> > >>>> > One question is - does my code still work the same as far as setting and >>>> > reading session variables? >>>> > >>>> > Thanks, >>>> > >>>> > Tom >>>> > >>>> >>>> >>> >>> >> >> > >
Show quote
Hide quote
"Juan T. Llibre" <nomailrepl***@nowhere.com> wrote in message Right. But what does the worker process recycling do? Does it affect the news:e%23bmVEdbFHA.3120@TK2MSFTNGP12.phx.gbl... > There's a lot of questions in your post, > but only is really critical, so I'll address it. > > re: >> I thought the session still gets recycled if in StateServer mode - you >> just don't lose the session variables. > > The session doen't get recycled when you use State Server. > The *ASP.NET worker process* gets recycled. > > The whole purpose of using State Server is to store the session variables > in a Windows service ( the State Server ) which does *not* recycle > when the ASP.NET worker process recycles, which means that > your session variables ( stored in the State Server) don't get lost. session? Tom Show quoteHide quote > > I hope that makes those concepts clearer. > > > > > Juan T. Llibre > ASP.NET MVP > http://asp.net.do/foros/ > Foros de ASP.NET en Español > Ven, y hablemos de ASP.NET... > ====================== > > "tshad" <tscheider***@ftsolutions.com> wrote in message > news:eciRe7cbFHA.612@TK2MSFTNGP12.phx.gbl... >> "Juan T. Llibre" <nomailrepl***@nowhere.com> wrote in message >> news:OhAgovabFHA.2696@TK2MSFTNGP09.phx.gbl... >>> Hi, Tshad. >>> >>> I see you've made some progress since the suggestion >>> to switch to State Server. Congratulations! >> >> Thanks - I will be checking it out today, but it seems to have solved the >> problem. >>> >>> re: >>>> One question that I have is if I am using stateServer, >>>> does the "worker process recycles" still happen? >>> >>> Yes, they do. >>> >> >> But what do they do? >> >> If the worker process recycles at a different time then the session >> timeouts - what is it doing and what is the point if the session is still >> live? >> >>> All ASP.NET worker processes you may have running >>> will get recycled depending on the way you configure them. >> >> Are you talking about the Application Pools Properties? >> >> There are various properties there that I am not sure what to do with. >> >> The only thing on the Recycle tab that I have checked is "Recycle work >> processes (in minutes)" and it is set to 1740. That is 29 hours - this >> obviously was not what was clearing my session variables. None of the >> others (Number of requests, specific time, memory) are checked. >> >> I assume that the Idle timeout might have been cause it (but it doesn't >> say recycle - it says shutdown the process. Would this clear the session >> variables? >> >> If this is supposed to release the resources - wouldn't this cause the >> session a problem, even if the session variables are there? >>> >>> State Server runs in a *different* process which doesn't get recycled >>> until you reboot the computer where the application is running, >>> and that's why the session variables aren't lost when the ASP.NET >>> worker process is recycled. >>> >> >> Wait. >> >> I thought the session still gets recycled if in StateServer mode - you >> just don't lose the session variables. >> >>> The two processes have independent lives, although they work together. >>> >>> re: >>>>If so, how does this affect my session? >>> >>> Your session variables continue to exist until the session times out >>> or until the box is rebooted. >>> >> >> But if the recycling happens and you lose your resources - how does the >> session still work? >> >> Tom >>> >>> >>> >>> Juan T. Llibre >>> ASP.NET MVP >>> http://asp.net.do/foros/ >>> Foros de ASP.NET en Español >>> Ven, y hablemos de ASP.NET... >>> ====================== >>> >>> "tshad" <t**@dslextreme.com> wrote in message >>> news:%23Fjpl1XbFHA.3712@TK2MSFTNGP09.phx.gbl... >>>> "Robbe Morris [C# MVP]" <i***@eggheadcafe.com> wrote in message >>>> news:uBMd2GWbFHA.2184@TK2MSFTNGP15.phx.gbl... >>>>> StateServer on a single box or a web farm with session affinity >>>>> will get rid of your periodic session loss with InProc. >>>>> >>>>> Read these, they'll be helpful >>>>> >>>>> ASP.NET Session FAQ >>>>> >>>>> http://www.eggheadcafe.com/articles/20021016.asp >>>> >>>> That answered a lot of questions ad I have already changed to >>>> "stateServer" >>>> mode and it seems to work fine. I will test it out more tomorrow. >>>> >>>> One question that I have is if I am using stateServer, does the >>>> "worker >>>> process recycles" still happen? If so, how does this affect my >>>> session? >>>> The articles say that you don't lose the session variables during the >>>> recycles. >>>> >>>> Also, if you the session times out (but you don't lose your sessionID - >>>> which is what the articles said until the browser closes), do you lose >>>> your >>>> session variables at this time when using "stateServer" mode? >>>> >>>> Thanks, >>>> >>>> Tom >>>> >>>>> >>>>> More info on how StateServer might help >>>>> >>>>> http://www.eggheadcafe.com/articles/20030416.asp >>>>> >>>>> Optional software to better manage InProc >>>>> session state outside of ASP.NET in a web farm. >>>>> >>>>> http://www.eggheadcafe.com/articles/scaleout_server.asp >>>>> >>>>> -- >>>>> 2004 and 2005 Microsoft MVP C# >>>>> Robbe Morris >>>>> http://www.masterado.net >>>>> >>>>> Earn $$$ money answering .NET Framework >>>>> messageboard posts at EggHeadCafe.com. >>>>> http://www.eggheadcafe.com/forums/merit.asp >>>>> >>>>> >>>>> >>>>> "tshad" <tscheider***@ftsolutions.com> wrote in message >>>>> news:OQZ3t8UbFHA.2796@TK2MSFTNGP10.phx.gbl... >>>>> >I have been using the default session state (InProc) and have found >>>>> >that >>>> I >>>>> >have been loosing my information after a period of time (normally 20 >>>>> >minutes). >>>>> > >>>>> > Is there anyway to find out how much more time I have on a session? >>>>> > >>>>> > If I do a refresh, does reset the session clock? >>>>> > >>>>> > Do you have have to go to another page to reset the session timeout >>>>> > or >>>>> > will a postback also do it? This is important as we have a few >>>>> > pages >>>> that >>>>> > a user will stay on where he will be doing all kinds of submits that >>>> will >>>>> > just do Postbacks (so the page doesn't change). This could be a >>>>> > problem >>>>> > if all of a sudden the timeout period comes up and the user has not >>>>> > left >>>>> > the page. All of a sudden, I get an error that says the session >>>> variable >>>>> > is blank. >>>>> > >>>>> > I am thinking of switching ot State Server or Sql Server mode, but >>>>> > am >>>> not >>>>> > sure of the drawbacks. Most of the books give a small idea of the >>>>> > different modes but not much on the pros and cons. >>>>> > >>>>> > One question is - does my code still work the same as far as setting >>>>> > and >>>>> > reading session variables? >>>>> > >>>>> > Thanks, >>>>> > >>>>> > Tom >>>>> > >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > The browser still keeps the session id. However, the server
had already dropped the session. So, if the browser sends the request with an invalid key, a new session would be created. Yes, if you use StateServer, session won't be lost when the process recycles. Session state is no longer held in that process. It has its own windows service. -- Show quoteHide quote2004 and 2005 Microsoft MVP C# Robbe Morris http://www.masterado.net Earn $$$ money answering .NET Framework messageboard posts at EggHeadCafe.com. http://www.eggheadcafe.com/forums/merit.asp "tshad" <t**@dslextreme.com> wrote in message news:%23Fjpl1XbFHA.3712@TK2MSFTNGP09.phx.gbl... > "Robbe Morris [C# MVP]" <i***@eggheadcafe.com> wrote in message > news:uBMd2GWbFHA.2184@TK2MSFTNGP15.phx.gbl... >> StateServer on a single box or a web farm with session affinity >> will get rid of your periodic session loss with InProc. >> >> Read these, they'll be helpful >> >> ASP.NET Session FAQ >> >> http://www.eggheadcafe.com/articles/20021016.asp > > That answered a lot of questions ad I have already changed to > "stateServer" > mode and it seems to work fine. I will test it out more tomorrow. > > One question that I have is if I am using stateServer, does the "worker > process recycles" still happen? If so, how does this affect my session? > The articles say that you don't lose the session variables during the > recycles. > > Also, if you the session times out (but you don't lose your sessionID - > which is what the articles said until the browser closes), do you lose > your > session variables at this time when using "stateServer" mode? > > Thanks, > > Tom > >> >> More info on how StateServer might help >> >> http://www.eggheadcafe.com/articles/20030416.asp >> >> Optional software to better manage InProc >> session state outside of ASP.NET in a web farm. >> >> http://www.eggheadcafe.com/articles/scaleout_server.asp >> >> -- >> 2004 and 2005 Microsoft MVP C# >> Robbe Morris >> http://www.masterado.net >> >> Earn $$$ money answering .NET Framework >> messageboard posts at EggHeadCafe.com. >> http://www.eggheadcafe.com/forums/merit.asp >> >> >> >> "tshad" <tscheider***@ftsolutions.com> wrote in message >> news:OQZ3t8UbFHA.2796@TK2MSFTNGP10.phx.gbl... >> >I have been using the default session state (InProc) and have found that > I >> >have been loosing my information after a period of time (normally 20 >> >minutes). >> > >> > Is there anyway to find out how much more time I have on a session? >> > >> > If I do a refresh, does reset the session clock? >> > >> > Do you have have to go to another page to reset the session timeout or >> > will a postback also do it? This is important as we have a few pages > that >> > a user will stay on where he will be doing all kinds of submits that > will >> > just do Postbacks (so the page doesn't change). This could be a >> > problem >> > if all of a sudden the timeout period comes up and the user has not >> > left >> > the page. All of a sudden, I get an error that says the session > variable >> > is blank. >> > >> > I am thinking of switching ot State Server or Sql Server mode, but am > not >> > sure of the drawbacks. Most of the books give a small idea of the >> > different modes but not much on the pros and cons. >> > >> > One question is - does my code still work the same as far as setting >> > and >> > reading session variables? >> > >> > Thanks, >> > >> > Tom >> > >> >> > > "Robbe Morris [C# MVP]" <i***@eggheadcafe.com> wrote in message Very confusing.news:OScR73bbFHA.2288@TK2MSFTNGP14.phx.gbl... > The browser still keeps the session id. However, the server > had already dropped the session. So, if the browser > sends the request with an invalid key, a new session would > be created. Trying to get my brain around the recycling verses the session dropping. When the session is dropped - you lose your session variables? So when you send a request with an invalid key - you get a new key, but all the variables are gone? Would the Session_Start event get fired at this point - since it has a new key (and a new session)? How do you know the session has been dropped? Is there an event fired to indicate this? I know that the Session_End event doesn't happen in StateServer or SqlState - how do you know that the State is still active? Should you look at something in the Page_Load event to make sure it is still active? Thanks, Tom Show quoteHide quote > > Yes, if you use StateServer, session won't be lost when > the process recycles. Session state is no longer held > in that process. It has its own windows service. > > -- > 2004 and 2005 Microsoft MVP C# > Robbe Morris > http://www.masterado.net > > Earn $$$ money answering .NET Framework > messageboard posts at EggHeadCafe.com. > http://www.eggheadcafe.com/forums/merit.asp > > > > "tshad" <t**@dslextreme.com> wrote in message > news:%23Fjpl1XbFHA.3712@TK2MSFTNGP09.phx.gbl... >> "Robbe Morris [C# MVP]" <i***@eggheadcafe.com> wrote in message >> news:uBMd2GWbFHA.2184@TK2MSFTNGP15.phx.gbl... >>> StateServer on a single box or a web farm with session affinity >>> will get rid of your periodic session loss with InProc. >>> >>> Read these, they'll be helpful >>> >>> ASP.NET Session FAQ >>> >>> http://www.eggheadcafe.com/articles/20021016.asp >> >> That answered a lot of questions ad I have already changed to >> "stateServer" >> mode and it seems to work fine. I will test it out more tomorrow. >> >> One question that I have is if I am using stateServer, does the "worker >> process recycles" still happen? If so, how does this affect my session? >> The articles say that you don't lose the session variables during the >> recycles. >> >> Also, if you the session times out (but you don't lose your sessionID - >> which is what the articles said until the browser closes), do you lose >> your >> session variables at this time when using "stateServer" mode? >> >> Thanks, >> >> Tom >> >>> >>> More info on how StateServer might help >>> >>> http://www.eggheadcafe.com/articles/20030416.asp >>> >>> Optional software to better manage InProc >>> session state outside of ASP.NET in a web farm. >>> >>> http://www.eggheadcafe.com/articles/scaleout_server.asp >>> >>> -- >>> 2004 and 2005 Microsoft MVP C# >>> Robbe Morris >>> http://www.masterado.net >>> >>> Earn $$$ money answering .NET Framework >>> messageboard posts at EggHeadCafe.com. >>> http://www.eggheadcafe.com/forums/merit.asp >>> >>> >>> >>> "tshad" <tscheider***@ftsolutions.com> wrote in message >>> news:OQZ3t8UbFHA.2796@TK2MSFTNGP10.phx.gbl... >>> >I have been using the default session state (InProc) and have found >>> >that >> I >>> >have been loosing my information after a period of time (normally 20 >>> >minutes). >>> > >>> > Is there anyway to find out how much more time I have on a session? >>> > >>> > If I do a refresh, does reset the session clock? >>> > >>> > Do you have have to go to another page to reset the session timeout or >>> > will a postback also do it? This is important as we have a few pages >> that >>> > a user will stay on where he will be doing all kinds of submits that >> will >>> > just do Postbacks (so the page doesn't change). This could be a >>> > problem >>> > if all of a sudden the timeout period comes up and the user has not >>> > left >>> > the page. All of a sudden, I get an error that says the session >> variable >>> > is blank. >>> > >>> > I am thinking of switching ot State Server or Sql Server mode, but am >> not >>> > sure of the drawbacks. Most of the books give a small idea of the >>> > different modes but not much on the pros and cons. >>> > >>> > One question is - does my code still work the same as far as setting >>> > and >>> > reading session variables? >>> > >>> > Thanks, >>> > >>> > Tom >>> > >>> >>> >> >> > >
Other interesting topics
|
|||||||||||||||||||||||