Skip to content

Commit

Permalink
Fix undefined $_SESSION error when calling Session::check
Browse files Browse the repository at this point in the history
If you call session::check() before a session has been started you get a undefined variable $_SESSION error.
  • Loading branch information
dakota committed May 23, 2014
1 parent c5f1d81 commit 2c55299
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Network/Session.php
Expand Up @@ -349,6 +349,10 @@ public function check($name = null) {
if ($this->_hasSession() && !$this->started()) {
$this->start();
}

if (!isset($_SESSION)) {
return null;
}

return Hash::get($_SESSION, $name) !== null;
}
Expand Down

0 comments on commit 2c55299

Please sign in to comment.