PC Review


Reply
Thread Tools Rate Thread

setting timeout for session

 
 
Scott Walters
Guest
Posts: n/a
 
      21st Nov 2003
Hi,

I have an asp.net webapp that uses some javascript in a hidden frame on
the browser to poll the server every 30 seconds, using an http post.

I also want my sessions to timeout in the normal fashion. The way I'm
trying to get around this is by manually setting the timeout property
for the session.

I cache the starting session timeout value and inspect each url I get.
When I get the polling url, I take 30 seconds off the timeout value and
call set_timeout with the new, reduced value. Every time I get a url
different from the polling url, I call set_timeout with the original,
cached value.

Everything seems to be working right in the code, but for some reason
the sessions always end very shortly after the first poll, even if I
continually post with the non-polling url and set the session timeout
value very high in the web.config file.

Can anyone tell me what's going on here?

Thanks,
Scott Walters

 
Reply With Quote
 
 
 
 
Scott M.
Guest
Posts: n/a
 
      22nd Nov 2003
Instead of continuously reducing the session.timeout property, how about
doing almost the same as you are doing now, but instead of setting the
timeout to a lower and lower value, just keep track of that value in a
variable. When the variable reaches zero, redirect the user to an .aspx page
that contains: Session.Abandon() and displays something like "Your session
has ended.".


"Scott Walters" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have an asp.net webapp that uses some javascript in a hidden frame on
> the browser to poll the server every 30 seconds, using an http post.
>
> I also want my sessions to timeout in the normal fashion. The way I'm
> trying to get around this is by manually setting the timeout property
> for the session.
>
> I cache the starting session timeout value and inspect each url I get.
> When I get the polling url, I take 30 seconds off the timeout value and
> call set_timeout with the new, reduced value. Every time I get a url
> different from the polling url, I call set_timeout with the original,
> cached value.
>
> Everything seems to be working right in the code, but for some reason
> the sessions always end very shortly after the first poll, even if I
> continually post with the non-polling url and set the session timeout
> value very high in the web.config file.
>
> Can anyone tell me what's going on here?
>
> Thanks,
> Scott Walters
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Timeout problems-web.confg session state and IIS session s =?Utf-8?B?Um9iSEs=?= Microsoft ASP .NET 4 11th Apr 2007 05:52 PM
IIS Timeout , Web Config Timeout, Page Timeout. =?Utf-8?B?TWlrZSBNb29yZQ==?= Microsoft Dot NET 0 17th Jan 2006 07:52 PM
ASPX Page Timeout - Session Timeout =?Utf-8?B?RGF2aWRT?= Microsoft ASP .NET 4 20th Jul 2004 09:39 PM
Session contents lost despite Session.Timeout = 3000; and <sessionState mode="InProc" cookieless="false" timeout="300"> Carpe Diem Microsoft ASP .NET 3 23rd Feb 2004 08:10 PM
web.config session timeout and forms authentication timeout Do Microsoft ASP .NET 2 23rd Nov 2003 03:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:02 AM.