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';
}