Browse Source

Merge pull request #1479 from DaSourcerer/session-cleanup

Removed compatibility code for PHP < 5.4 in yii\web\Session
tags/2.0.0-beta
Alexander Makarov 11 years ago
parent
commit
7b03233805
  1. 8
      framework/yii/web/Session.php

8
framework/yii/web/Session.php

@ -179,13 +179,7 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
*/ */
public function getIsActive() public function getIsActive()
{ {
if (function_exists('session_status')) { return session_status() == PHP_SESSION_ACTIVE;
// available in PHP 5.4.0+
return session_status() == PHP_SESSION_ACTIVE;
} else {
// this is not very reliable
return $this->_opened && session_id() !== '';
}
} }
/** /**

Loading…
Cancel
Save