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,
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@.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-sess... Sent from the Seaside General mailing list archive at Nabble.com.
On Thu, Jan 29, 2015 at 3:27 PM, Paul DeBruicker pdebruic@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@.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-sess... Sent from the Seaside General mailing list archive at Nabble.com. _______________________________________________ seaside mailing list seaside@lists.squeakfoundation.org http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
seaside@lists.squeakfoundation.org