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

Mariano Martinez Peck marianopeck at gmail.com
Thu Feb 5 15:59:27 UTC 2015


On Thu, Jan 29, 2015 at 3:27 PM, Paul DeBruicker <pdebruic at gmail.com> wrote:

> 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.
>
>
Thanks Paul!!! That did work perfectly.

Thank you very much.



>
>
> 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.
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>



-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20150205/d875bb2e/attachment.htm


More information about the seaside mailing list