Session Variables

T

TC

How long does it take a session variable to expire or loose it´s value, or
it the value stored until the client closes the browser window?

TIA
 
K

Kevin Spencer

Hi TC,

The default is 20 minutes after the last request from the client. As the
server has no way of knowing what the client does after receiving a request,
it is not dependent upon the client.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
T

TC

How can I change this, or do I have to validate in every page that the
session variable still has some value?

Thanks
 
K

Kevin Spencer

Hi TC,

As Sessions time out (and you can't change that, only the time interval), it
is ALWAYS a good idea to check for and handle the eventuality that some
Sessions will time out. Changing the timeout is usually a bad idea, as it
causes more memory usage on the server. Each Session allocates memory, and
the more Sessions that are alive, the more memory will be used at any given
point.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 

Ask a Question

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

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

Ask a Question

Top