Check whether session started using Predefined Constants
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
The constants 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)
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();
}