php - Force login after ajax request -
KP php 2.4 via IP. My problem sometimes after the session is inactive or logout in another tab The request does not work because the user has already been logged out. My question is how can I verify the user to redirect to the login page. My function, which is used to filter my requests, is used on my user control class
// class UsersController public function beforefilter () {parent: beforeFilter (); // Allow user to log out $ this- & gt; Auth-> Allow ('logout'); } thanks
if (! $ - & gt; Session-> Read ('Auth.User')) {// Redirect Here}
Comments
Post a Comment