check if a session is set php code example
Example 1: check if session variable exists php
if (isset($_SESSION['errors']))
{
//Do stuff
}
Example 2: php check if session is running
<?php
if(session_status() == PHP_SESSION_ACTIVE){
//a session is already running
session_destroy(); //stops the session
}
?>