[Seaside] Keep-alive timer for Seaside app

Tony Fleig tony.fleig at gmail.com
Wed Jan 5 23:20:56 UTC 2011


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.

More information about the seaside mailing list