Thursday, September 5, 2013

Ajax Login - Redirect Help

I have / working on a site where 90% of the admin area is handled via ajax / json.

 

So I am at the point where I login, destroy the session (on purpose) and try to perform an action, which obviously fails but how can I trigger it to force the user back to login page, your session has expired please login to continue message type setup?

 

I know about 'ajaxLogin' => '/Elements/users/ajax_login', which is what I used before altering all calls to be JSON so no HTML is now getting spit back to the view.

Just wondering what the easiest, site wide approach would be to direct a user to the login page if their session has expired when attempting an ajax request.

 

Any and all ideas welcome,

 

Thanks

 

Dave

No comments: