Check whether session started using Predefined Constants
if (session_status() == PHP_SESSION_NONE) {
    session_start();
}Queste costanti sono definite da questa estensione e sono disponibili solo se l'estensione è stata compilata nel PHP o se è stata caricata dinamicamente a runtime.
SID
    (string)
   "name=ID" or empty string
     if session ID was set in an appropriate session cookie. This is
     the same id as the one returned by session_id().
    
   PHP_SESSION_DISABLED
    (int)
   PHP_SESSION_NONE
    (int)
   PHP_SESSION_ACTIVE
    (int)
   Check whether session started using Predefined Constants
if (session_status() == PHP_SESSION_NONE) {
    session_start();
}