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