Session.Timeout

N

Nathan Sokalski

I have a page that uses Session variables when generating the SQL statements
used to submit and retrieve data from a database. However, because I don't
know how long the user will be on the page, setting the Session.Timeout
property doesn't help me avoid errors (I can obviously set the value to a
very high value, but that still doesn't completely solve the problem). Is
there any way for me to avoid the Session timing out? Thanks.
 
B

bruce barker

switch to the sql state server. you can then bump the session to days or
weeks.

-- bruce (sqlwork.com)
 
N

Nathan Sokalski

How exactly does the sql state server work? I am using SQL Server in this
case, but I have a couple questions:

1. What is the syntax for sql state server? Could you give me an example or
direct me to a page that does?

2. What if I am not using SQL Server, or what if a database is not involved
at all?

3. Even though it is not a likely scenario in the case of the site I am
working on, some people leave their browsers open for VERY long times, for
example, if a site is informational, they might keep it minimized for a long
time and occasionally look at it as a reference.

Thanks.
 
H

Hans Kesting

I have a page that uses Session variables when generating the SQL
statements used to submit and retrieve data from a database. However,
because I don't know how long the user will be on the page, setting
the Session.Timeout property doesn't help me avoid errors (I can
obviously set the value to a very high value, but that still doesn't
completely solve the problem). Is there any way for me to avoid the
Session timing out? Thanks.

Instead of setting the session timeout to long values, maybe you can
prevent the session from timing out, by using regular postbacks.

A session timeout of an hour means that the session variables stay
around for an hour after the user has closed his browser.

You could use a regular (once every 10 minutes is enough, as long as it is
within the regular session timeout) AJAX callback that does nothing special
except (by it's callback) refresh the session. You will need to enable
session-state for this callback however.
The user should not notice this and the session is kept open as long as
that user keeps the page open. And the session is ended reasonably
soon after he has closed his browser.

Hans Kestin
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top