Answers for "How to check if a session is expired or never was set in php"

PHP
0

How to check if a session is expired or never was set in php

session_start();
if ($_COOKIE(session_name() && !count($_SESSION)) {
    print "session has expired";
    exit;
} elsif (!$_COOKIE(session_name()) {
    print "You need to login first";
    exit;
} else {
    print "welcome back....";
    ....
Posted by: Guest on March-11-2022

Code answers related to "How to check if a session is expired or never was set in php"

Browse Popular Code Answers by Language