[Seaside] handling expired sessions
Bob Arning
arning at charm.net
Thu Jun 17 18:07:40 UTC 2010
Jan,
I tried this:
-------------------------------------
renderContentOn: html
html document addLoadScript: (
(html prototype request) onFailure:
(html javascript alert: 'The session has expired.')
).
[snip]
--------------------------------------
also tried #onException: rather than #onFailure:, but nothing is
popping up, even though the response status is 404.
Do you (or anyone) have any suggestions?
Cheers,
Bob
On Jun 17, 2010, at 5:00 AM, Jan van de Sandt wrote:
> 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
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
More information about the seaside
mailing list