Re: seaside Digest, Vol 97, Issue 14

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: seaside Digest, Vol 97, Issue 14

Paul DeBruicker
On 01/05/2011 10:07 PM, [hidden email] wrote:

> Message: 4
> Date: Wed, 5 Jan 2011 15:20:56 -0800
> From: Tony Fleig<[hidden email]>
> Subject: [Seaside] Keep-alive timer for Seaside app
> To: Seaside - general discussion<[hidden email]>
> Message-ID:
> <AANLkTinAAnzmPt+G1HwhnhBN=[hidden email]>
> 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
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: seaside Digest, Vol 97, Issue 14

tfleig
Thanks! That's a lot simpler!

TF

Sent from my iPhone

On Jan 5, 2011, at 7:42 PM, Paul DeBruicker <[hidden email]> wrote:

> On 01/05/2011 10:07 PM, [hidden email] wrote:
>> Message: 4
>> Date: Wed, 5 Jan 2011 15:20:56 -0800
>> From: Tony Fleig<[hidden email]>
>> Subject: [Seaside] Keep-alive timer for Seaside app
>> To: Seaside - general discussion<[hidden email]>
>> Message-ID:
>>    <AANLkTinAAnzmPt+G1HwhnhBN=[hidden email]>
>> 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
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside