user5897
0
Q:

php check if session started

session_status();

// Possible results:
//  - PHP_SESSION_DISABLED = 0
//  - PHP_SESSION_NONE     = 1
//  - PHP_SESSION_ACTIVE   = 2
0
<?php
if(session_status() == PHP_SESSION_NONE){
    //session has not started
    session_destroy();
}
-1
#you could just ignore warnings messages
@session_start();
0
if (session_status() == PHP_SESSION_NONE) {
    session_start();
}
0

New to Communities?

Join the community