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 10 3478
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
--
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" <ts**********@ftsolutions.com> wrote in message
news:OQ**************@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
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. 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
"Craig Deelsnyder" <cdeelsny@NO_SPAM_4_MEyahoo.com> wrote in message
news:eI**************@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.
Well, that would make sense except that I am in development mode and am
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 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...
Mainly for testing purposes. SqlServer and StateServer are useful for when you want to persist the session across webserver restarts;
Does this include the worker process recycles? Or does it not do these
recycles in these modes?
Tomit 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
"Robbe Morris [C# MVP]" <in**@eggheadcafe.com> wrote in message
news:uB**************@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" <ts**********@ftsolutions.com> wrote in message news:OQ**************@TK2MSFTNGP10.phx.gbl...I have been using the default session state (InProc) and have found that
Ihave 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, does the "worker process recycles" still happen?
Yes, they do.
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 out
or 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...
======================
"tshad" <tf*@dslextreme.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... "Robbe Morris [C# MVP]" <in**@eggheadcafe.com> wrote in message news:uB**************@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" <ts**********@ftsolutions.com> wrote in message news:OQ**************@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.
--
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" <tf*@dslextreme.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... "Robbe Morris [C# MVP]" <in**@eggheadcafe.com> wrote in message news:uB**************@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" <ts**********@ftsolutions.com> wrote in message news:OQ**************@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" <no***********@nowhere.com> wrote in message
news:Oh**************@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" <tf*@dslextreme.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... "Robbe Morris [C# MVP]" <in**@eggheadcafe.com> wrote in message news:uB**************@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" <ts**********@ftsolutions.com> wrote in message news:OQ**************@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]" <in**@eggheadcafe.com> wrote in message
news:OS**************@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.
Very confusing.
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 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" <tf*@dslextreme.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... "Robbe Morris [C# MVP]" <in**@eggheadcafe.com> wrote in message news:uB**************@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" <ts**********@ftsolutions.com> wrote in message news:OQ**************@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 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.
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" <ts**********@ftsolutions.com> wrote in message
news:ec*************@TK2MSFTNGP12.phx.gbl... "Juan T. Llibre" <no***********@nowhere.com> wrote in message news:Oh**************@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" <tf*@dslextreme.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... "Robbe Morris [C# MVP]" <in**@eggheadcafe.com> wrote in message news:uB**************@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" <ts**********@ftsolutions.com> wrote in message news:OQ**************@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" <no***********@nowhere.com> wrote in message
news:e%****************@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.
Right. But what does the worker process recycling do? Does it affect the
session?
Tom 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" <ts**********@ftsolutions.com> wrote in message news:ec*************@TK2MSFTNGP12.phx.gbl... "Juan T. Llibre" <no***********@nowhere.com> wrote in message news:Oh**************@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" <tf*@dslextreme.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... "Robbe Morris [C# MVP]" <in**@eggheadcafe.com> wrote in message news:uB**************@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" <ts**********@ftsolutions.com> wrote in message > news:OQ**************@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 > > > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Nhi Lam |
last post by:
Hi,
I understand that there are 3 modes in which I can
configure the SessionStateModule. What I need is an out of
process Session State store with fail over support.
The "SQL Server Mode" seems...
|
by: karahan celikel |
last post by:
I realized that when SqlServer mode is used for session management
Session_End event is not fired in global.asax.
What can I do if I want to do something when a user's session end?
Thanks
|
by: RA |
last post by:
Hi
If I use session variables does this depends on cookies being sent to the
client browser? If yes then what happens if the user disable cookies?
Thanks
|
by: John A Grandy |
last post by:
for high traffic public websites , what are the proven options for
session-state storage & management ?
is an out-of-process state-server generally preferred over a sql-server ?
what are the...
|
by: fm |
last post by:
We are using State Server to host our session objects.
We have several applications running under IIS that will be using the State
Server.
How can one of those applications clear its Session...
| |
by: sdettmers |
last post by:
Hi,
Database: SQL Server
Session: SQL Server
Language: C#
Application: ASP.Net
I have created a login page which attempts to retrieve the users record
from the database and I...
|
by: Dave |
last post by:
I have an application running on a 3 server webfarm running Windows 2003 with
SQLServer Session state. After running for several hours, I started getting
the following error. When I access each...
|
by: none |
last post by:
Hi,
I've got a problem with losing session state in ASP.NET version 2.
It does it intermittently - sometimes it tanks - and sometimes it works OK.
I've got the ASP.NET state service started...
|
by: Abi |
last post by:
We able to generate this error in our test environment and were able to
research this enough to understand that the issue is NOT with an abject that
needs to be serialized but rather as the stack...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |