In my php function here, i want to check if the session exists or not. based on the session existence i want to return true or false.
i have a login function which uses session_start();
and stores values into session variables when logged in, and when logged out it will do session_destroy();
now i want to check if the session exists or not. How can i do that
function ifsessionExists(){
// check if session exists?
if($_SESSION[] != ''){
return true;
}else{
return false;
}
}