[Seaside] Re: seaside Digest, Vol 97, Issue 14
Tfleig
tony.fleig at gmail.com
Thu Jan 6 06:26:08 UTC 2011
Thanks! That's a lot simpler!
TF
Sent from my iPhone
On Jan 5, 2011, at 7:42 PM, Paul DeBruicker <pdebruic at gmail.com> wrote:
> 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>
>> Message-ID:
>> <AANLkTinAAnzmPt+G1HwhnhBN=XrW-heV+OVxoPj4cLDQ at mail.gmail.com>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> Hi,
>>
>> 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:
>
> renderKeepAlive: html
> | requestDuration |
> requestDuration := 9 minutes.
> html
> script:
> ((html jQuery ajax)
> html: '';
> interval: requestDuration).
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
More information about the seaside
mailing list