if your request was redirected to login page then you would get HTML of the login page returned. chances are you are getting 500 error response header by design. This way you can deal with it using "onFailure" callback handler. The problem though is that generic 500 status code is not specific enough so you probably should not assume that the error is always due to session timeout. If you find a way to generate custom headers within Cake's Auth than you can parse it on client side and have more flexibility in error handling
Here is what I do with session timeouts - when laoded, each protected page starts JavaScript timer that redirects user to a "session expired" page after certain period of inactivity. This way users never see access protected pages with stale session information. On Jun 23, 9:00 am, James K <[EMAIL PROTECTED]> wrote: > Has anyone else come into this problem? I'm using Cake's Auth > component and the Request Handler to do my login system. Logging in is > done via a standard non-AJAX Cake generated form using the Form > Helper. The user is authenticated and then forwarded to the > application which makes heavy use of AJAX requests. If the user's > session times out, any successive AJAX calls will result in a 500 > error (according to FireBug), and will give the user no feedback (the > loading bar will just sit there forever). > > I suspect it has some issue with cake trying to forward the AJAX > request to the login page (which is a regular page with a non-AJAX > layout). I'd like to handle the situation more gracefully like > forwarding to a page which will spawn a login box, or at the VERY > least throw a "sorry, your session has timed out" message. Is there > any way to catch a session timeout from an AJAX request and handle it > separately via the Auth component? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
