/** * Login with cookie */ public function loginWithCookie() { // run the loginWithCookie() method in the login-model, put the result in $login_successful (true or false) $login_successful = LoginModel::loginWithCookie(Request::cookie('remember_me')); // if login successful, redirect to dashboard/index ... if ($login_successful) { Redirect::to('dashboard/index'); } else { // if not, delete cookie (outdated? attack?) and route user to login form to prevent infinite login loops LoginModel::deleteCookie(); Redirect::to('login/index'); } }