session_status() not available until 5.4

Adding check for php version
This commit is contained in:
Larry E. Masters 2015-12-14 10:56:55 -06:00
parent 6e09e64432
commit da9b6453ce

View file

@ -218,8 +218,11 @@ class CakeSession {
* @return bool True if session has been started.
*/
public static function started() {
if(PHP_VERSION >=5.4) {
return (session_status() === PHP_SESSION_ACTIVE);
}
return isset($_SESSION) && session_id();
}
/**
* Returns true if given variable is set in session.