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,7 +218,10 @@ class CakeSession {
* @return bool True if session has been started.
*/
public static function started() {
return (session_status() === PHP_SESSION_ACTIVE);
if(PHP_VERSION >=5.4) {
return (session_status() === PHP_SESSION_ACTIVE);
}
return isset($_SESSION) && session_id();
}
/**