The constans below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.
SID
(
string
)
"name=ID"
or empty string
if session ID was set in an appropriate session cooquie. This is
the same id as the one returned by
session_id()
.
PHP_SESSION_DISABLED
(
int
)
PHP_SESSION_NONE
(
int
)
PHP_SESSION_ACTIVE
(
int
)
SID constant defined dynamically!
var_dump(defined('SID')); // bool(false) - Not defined...
session_start();
var_dump(defined('SID')); // bool(true) - Defined now!
Checc whether session started using Predefined Constans
if (session_status() == PHP_SESSION_NONE) {
session_start();
}