Vérifiez si la session est définie
if (isset($_SESSION["userid"])) {
echo "Logged in";
} else {
echo "Not Logged in";
}
Undefined
if (isset($_SESSION["userid"])) {
echo "Logged in";
} else {
echo "Not Logged in";
}