问题
session_status() keeps returning 1 (PHP_SESSION_NONE) every time I visit localhost page. I know storing variables, session_start() and session_destroy() work because of the files in c:\xamp\tmp (defined in php.ini)
But why doesnt it register as session in code?
if (session_status() === PHP_SESSION_NONE) {
session_start();
echo session_status();
} else{
echo "active";
}
Any help would be appreciated, thank you
回答1:
we mostly use isset for condition on session variable
if(isset($_SESSION['var'])){
echo "Welcome". $_SESSION['var'];
}
maybe its helpfull for you :)
来源:https://stackoverflow.com/questions/60083271/php-xamp-session-status-is-always-1