You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I'm having problems checking if the user is logged in.
$this->auth->login($username, $password);
if ($this->auth->isLoggedIn())
return [
'status' => 'ok'
];
return 'Something went wrong';
Here the isLoggedIn returns true which is OK. But when I redirect to another page...
public function index() {
// Check if user is logged in
// else redirect to LogInPage
$db = new Database;
$auth = new \Delight\Auth\Auth(
$db->getPDO(), null, null, false, 60);
if (!$auth->isLoggedIn()) {
redirect('users/#');
}
editPath(null, "reset");
$result = $this->pagesModel->sendCommand(123456, "EXPLORE", "/");
setSendedCmdId($result[0]->ID);
$pathsError = '';
// if (!$result) {
// $pathsError = 'There was a problem when sending the command';
// }
$data = [];
$this->view('pages/index', $data);
}
...
In the index method I recreate de auth instance and when I call isLoggedIn() it returns false.
The text was updated successfully, but these errors were encountered:
Hello! I'm having problems checking if the user is logged in.
$this->auth->login($username, $password);
if ($this->auth->isLoggedIn())
return [
'status' => 'ok'
];
return 'Something went wrong';
Here the isLoggedIn returns true which is OK. But when I redirect to another page...
...
In the index method I recreate de auth instance and when I call isLoggedIn() it returns false.
The text was updated successfully, but these errors were encountered: