Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Cast deleteOldSession to bool
Browse files Browse the repository at this point in the history
- Casts $deleteOldSession to (bool) before calling session_regenerate_id()
  • Loading branch information
weierophinney committed Feb 23, 2012
1 parent 9482859 commit fca746d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/SessionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,16 +264,17 @@ public function setId($id)
* Regenerate the session ID, using session save handler's
* native ID generation Can safely be called in the middle of a session.
*
* @param bool $deleteOldSession
* @param bool $deleteOldSession
* @return SessionManager
*/
public function regenerateId($deleteOldSession = true)
{
if (!$this->sessionExists()) {
session_regenerate_id($deleteOldSession);
session_regenerate_id((bool) $deleteOldSession);
return $this;
}
session_regenerate_id($deleteOldSession);

session_regenerate_id((bool) $deleteOldSession);
return $this;
}

Expand Down

0 comments on commit fca746d

Please sign in to comment.