[Seaside] Re: seaside Digest, Vol 97, Issue 14
pdebruic at gmail.com
Thu Jan 6 03:42:08 UTC 2011
On 01/05/2011 10:07 PM, seaside-request at lists.squeakfoundation.org wrote:
> Message: 4
> Date: Wed, 5 Jan 2011 15:20:56 -0800
> From: Tony Fleig<tony.fleig at gmail.com>
> Subject: [Seaside] Keep-alive timer for Seaside app
> To: Seaside - general discussion<seaside at lists.squeakfoundation.org>
> <AANLkTinAAnzmPt+G1HwhnhBN=XrW-heV+OVxoPj4cLDQ at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> I want to keep my Seaside app's session from expiring as long as the
> user's browser page is open, even if the user does not interact with
> the page.
> I came up with the following method and it seems to work when rendered
> in the page.
> My questions are:
> Is there better way to do this?
> Is there an easier way to get the cacheTimeout value?
> Do I really need two JSScript instances to create the interval
> timer? I couldn't find a better solution.
> renderKeepAlive: html
> | script cacheTimeout |
> cacheTimeout := self session application cache expiryPolicy
> configuration at: #cacheTimeout.
> script := JSScript new
> add: (JSScript new
> add: (html jQuery ajax callback: [
> Transcript cr; show: 'keepalive']));
> interval: (cacheTimeout - 60) seconds asDuration.
> html document addLoadScript: script.
I do it like this:
| requestDuration |
requestDuration := 9 minutes.
((html jQuery ajax)
More information about the seaside