Answers for "php check session"

PHP
4

check debian version

$ lsb_release -a
Posted by: Guest on May-06-2021
0

php start session if not started

if (session_status() == PHP_SESSION_NONE) {
    session_start();
}
Posted by: Guest on November-30-2020
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
0

php check session status

session_status();

// Possible results:
//  - PHP_SESSION_DISABLED = 0
//  - PHP_SESSION_NONE     = 1
//  - PHP_SESSION_ACTIVE   = 2
Posted by: Guest on July-07-2020

Browse Popular Code Answers by Language