[Seaside] handling expired sessions

Jan van de Sandt jvdsandt at gmail.com
Thu Jun 17 09:00:38 UTC 2010


Hello,

I know how to handle this with jQuery, See the following method from the
jQuery functional tests:

renderTimeoutOn: html
    "Warn the user if an error occurs during an AJAX action (mostly this is
a session timeout) and refreshes the current page (causing the default
error/expiry handling to kick in)."

    html document addLoadScript: (html jQuery ajaxSetup
        onError: (html javascript
            alert: 'The session has expired.';
            refresh)).

    "An alternative implementation is to trigger a request now and then so
that the session never expires:"
    "html document addLoadScript: (html jQuery ajax
        callback: [ 'the session is active' ];
        interval: 60 seconds)"

There must be something similar for Scriptaculous.

Jan.



On Wed, Jun 16, 2010 at 8:51 PM, Bob Arning <arning at charm.net> wrote:

> I've got a problem with expired sessions. If I have a component like the
> one below and the session expires, then clicking on the red box does
> nothing. No error message, no redisplay, nothing that the user can see.
> What's a good way to let the user know what's going on here?
>
> TIA,
> Bob
>
> 'From PharoCore1.0rc1 of 19 October 2009 [Latest update: #10505] on 16 June
> 2010 at 1:52:05 pm'!
> WAComponent subclass: #BobTestComponent
>        instanceVariableNames: ''
>        classVariableNames: ''
>        poolDictionaries: ''
>        category: 'Bob001'!
>
> !BobTestComponent methodsFor: 'as yet unclassified' stamp: 'Bob 6/16/2010
> 13:51'!
> renderContentOn: html
>
>        | div |
>
>        (div := html div)
>                style: 'height: 44px; width: 65px; background-color: red;';
>                id: 'bob001';
>                onClick: (html scriptaculous evaluator
>                        callback: [ :script |
>                                self replaceIt: script
>                        ];
>                        return: false);
>                with: [html text: 'aaa']
> ! !
>
> !BobTestComponent methodsFor: 'as yet unclassified' stamp: 'Bob 6/16/2010
> 13:33'!
> replaceIt: script
>
>        script element
>                id: 'bob001';
>                replace: [ :html |
>                        html div
>                                style: 'height: 44px; width: 65px;
> background-color: green;';
>                                id: 'bob001';
>                                with: [html text: 'two']
>                ].
> ! !
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>



-- 
Jan van de Sandt
gsm: +31 (0)6 3039 5998
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100617/a19f3a78/attachment-0001.htm


More information about the seaside mailing list