Skip to content

Commit

Permalink
Allow to set system.session.timeout to 0 to clear session on browse…
Browse files Browse the repository at this point in the history
…r close (#1538)

* Allow to set expire to 0 to clear session on browser close

* Changelog
  • Loading branch information
flaviocopes authored Jun 29, 2017
1 parent 144fcf4 commit 08920d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# v1.3.0-rc.5
## mm/dd/2017

1. [](#new)
* Setting `system.session.timeout` to 0 clears the session when the browser session ends [#1538](https://github.com/getgrav/grav/pull/1538)
1. [](#bugfix)
* Fixed global media files disappearing after a reload [#1545](https://github.com/getgrav/grav/issues/1545)
* Set folder name as required during validation [grav-plugin-admin#1146](https://github.com/getgrav/grav-plugin-admin/issues/1146)
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function init()
}
$this->setName($session_name);
$this->start();
setcookie(session_name(), session_id(), time() + $session_timeout, $session_path, $domain, $secure, $httponly);
setcookie(session_name(), session_id(), $session_timeout ? time() + $session_timeout : 0, $session_path, $domain, $secure, $httponly);
}
}

Expand Down

0 comments on commit 08920d5

Please sign in to comment.