Answer the question
In order to leave comments, you need to log in
How to work with Session correctly?
Question about session_abort() function ..
Why can I access data in session array after calling this method?
print_r($_SESSION);
echo '<br>';
echo session_start();
try {
if(Login::getInstance()->logger($_POST)){
echo $_SESSION['email'] = $_POST['email'].' Logged in!';
}
}catch (LoginFailed $login){
session_abort();
echo $login->getMessage();
}catch (ValidationError $error){
session_abort();
$errors = $error->getErrors();
foreach ($errors as $key => $value){
if (is_array($value)){
foreach ($value as $inner_value){
echo '<br>';
echo 'Valid email example => '.$inner_value;
}
return;
}
echo $error->getMessage().strtoupper($key).' => '.$value;
}
}catch (DatabaseConnectionError $error){
session_abort();
echo $error->getMessage();
}
echo '<br>';
print_r($_SESSION);
echo '<br>';
var_dump(session_status()== PHP_SESSION_ACTIVE);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question