Skip to content

Commit

Permalink
Merge pull request #5 from jasonswan/master
Browse files Browse the repository at this point in the history
Fix bug that would cause first token to not be inserted into session
  • Loading branch information
banujan6 authored Mar 12, 2019
2 parents d09d7fd + 5669a84 commit e6cdfff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/csrfhandler/csrf.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ private static function setToken($token)
self::startSession();

$tokenList = unserialize($_SESSION['X-CSRF-TOKEN-LIST']);
if (!is_array($tokenList))
{
$tokenList = array();
}
array_push($tokenList, $token);
$_SESSION['X-CSRF-TOKEN-LIST'] = serialize($tokenList);
}
Expand Down

0 comments on commit e6cdfff

Please sign in to comment.