Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Session.Timeout

Reply
Thread Tools

Session.Timeout

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      07-31-2007
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.
--
Nathan Sokalski
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      07-31-2007
switch to the sql state server. you can then bump the session to days or
weeks.

-- bruce (sqlwork.com)

Nathan Sokalski wrote:
> 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.

 
Reply With Quote
 
 
 
 
Nathan Sokalski
Guest
Posts: n/a
 
      08-01-2007
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.
--
Nathan Sokalski
(E-Mail Removed)
http://www.nathansokalski.com/

"bruce barker" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> switch to the sql state server. you can then bump the session to days or
> weeks.
>
> -- bruce (sqlwork.com)
>
> Nathan Sokalski wrote:
>> 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.



 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      08-01-2007
re:
!> How exactly does the sql state server work?

It stores session state in a SQL Server database.

re:
!> Could you give me an example or direct me to a page that does?

http://msdn2.microsoft.com/en-us/library/ms178586.aspx




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/
======================================
"Nathan Sokalski" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> 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.
> --
> Nathan Sokalski
> (E-Mail Removed)
> http://www.nathansokalski.com/
>
> "bruce barker" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
>> switch to the sql state server. you can then bump the session to days or weeks.
>>
>> -- bruce (sqlwork.com)
>>
>> Nathan Sokalski wrote:
>>> 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.

>
>



 
Reply With Quote
 
Hans Kesting
Guest
Posts: n/a
 
      08-01-2007
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments