getToken() && $user->getPermission() != "-1") { Session::put('uid' , $_COOKIE['uid']); Session::put('token', $_COOKIE['token']); } else { // delete cookies setcookie("uid", "", time() - 3600, '/'); setcookie("token", "", time() - 3600, '/'); } } $user = session()->has('uid') ? new User(session('uid')) : null; echo \View::make('index')->with('user', $user); } }