[Seaside] Re: Ajax requests not redirecting to Login page after session timeout

Paul DeBruicker pdebruic at gmail.com
Thu Jan 29 18:27:38 UTC 2015


Hi Mariano,

Thats something I wrote.  The #ajaxErrorHandler method goes like this:


ajaxErrorHandler
	^ ' if (jqxhr.status == 403) {
            alert("For security reasons we sign people out during periods of
inactivity. Please sign in again.");
            window.location.href =
settings.url.split("?")[0].replace("help","");
        } else {
            alert("This program just broke. You can either try again, sign
out and sign in and try again, or contact us about error: " + exception);  
        }'


the window.location.href line just cleans up the page url by removing the
expired session info.  Seaside then starts a new session and the url is sent
through the #initialRequest: mechanism.  In #initialRequest: for my
application I detect which page they were on, show them the login page, then
once they've authenticated show them the page they were on.  



Hope this helps


Paul.






Mariano Martinez Peck wrote
> Hi guys,
> 
> If I have a session timeout, and then I click on a anchor that is
> associated to a ajax call, it does nothing (which is expected) but it does
> not forward me to the Login page either, as it happens with a timeout and
> a
> normal request.
> 
> Any idea how can solve this?
> 
> I saw in another email this:
> 
>         html document
>                 addLoadScript:
>                         (html jQuery document
>                                 onAjaxError: (self ajaxErrorHandler
> asFunction: #('event' 'jqxhr'
> 'settings' 'exception')))
> 
> But not sure if it is of help.
> 
> Thanks in advance,
> 
> 
> 
> -- 
> Mariano
> http://marianopeck.wordpress.com
> 
> _______________________________________________
> seaside mailing list

> seaside at .squeakfoundation

> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside





--
View this message in context: http://forum.world.st/Ajax-requests-not-redirecting-to-Login-page-after-session-timeout-tp4802509p4802521.html
Sent from the Seaside General mailing list archive at Nabble.com.


More information about the seaside mailing list