Answers for "check session exist in php"

PHP
1

check if session variable exists php

if (isset($_SESSION['errors']))
{
    //Do stuff
}
Posted by: Guest on May-06-2020
0

check session php

// For PHP versions > 5.4.0

if (session_status() === PHP_SESSION_NONE) {
    session_start();
}

// For PHP Versions < 5.4.0

if(session_id() == '') {
    session_start();
}
Posted by: Guest on March-09-2021

Code answers related to "check session exist in php"

Browse Popular Code Answers by Language