Answer the question
In order to leave comments, you need to log in
Why isn't the session working?
Hello, I encountered sessions for the first time. Help, please, to understand why the session start does not work?
if(empty($_POST['name'])){
.....
}
else{
if(isset($_SESSION["test"])){
unset($_SESSION["test"]);
session_destroy();
}
session_start();
$_SESSION["test"] = md5(time());
header('Location: /test');
}
if(isset($_SESSION["test"])){
echo 'yes';
} else{
echo 'no';
}
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