Skip to content

Commit

Permalink
Session tempdata fix for 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnieezell committed Jan 19, 2017
1 parent 5f13ed2 commit c8d5436
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions system/Session/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,10 @@ public function markAsTempdata($key, $ttl = 300)
$k = $v;
$v = $ttl;
}
elseif (is_string($v))
{
$v = time() + $ttl;
}
else
{
$v += time();
Expand Down
3 changes: 3 additions & 0 deletions tests/system/Session/SessionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ public function testSetTempDataArraySingleTTL()
$this->assertTrue(($time + 200) <= $_SESSION['__ci_vars']['baz']);
}

/**
* @group single
*/
public function testGetTestDataReturnsAll()
{
$session = $this->getInstance();
Expand Down

0 comments on commit c8d5436

Please sign in to comment.