Don't know if this is the best way of handling this, but this is what I do: 
https://gist.github.com/classoutfit/6459420 It seems to work pretty well.



Jeremy Burns
Class Outfit






Mob: +44 (0) 7973 481949
Tel: +44 (0) 208 123 3822
Skype: jeremy_burns
classoutfit.com
@classoutfit

On 5 Sep 2013, at 21:51, "Advantage+" <movepix...@gmail.com> wrote:

> 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
> 
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

<<inline: mail.png>>

Reply via email to