-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Improve session cookie handling #39916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0702e57
d6fae06
159abed
aacf4b9
82983a9
35a0b2d
e685664
0269682
f0aae57
16b5333
ace36d7
5deebbc
b3900aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| Enhancement: Changes regarding cookie handling | ||
|
|
||
| The following changes have been implemented: | ||
| * The expiration set for the passphrase cookie will be refreshed each time | ||
| a page is loaded or when the "heartbeat" endpoint is hit | ||
| * If the "session_keepalive" config option is set to true, a periodic request | ||
| to the "heartbeat" endpoint will be made automatically regardless of any | ||
| activity going on. This will extend the session lifetime preventing its | ||
| expiration. | ||
| * If the "session_keepalive" config option is set to false, a "heartbeat" will | ||
| be sent based on activity in order to extend the session lifetime. If we | ||
| don't detect any activity, the session might expire, and the user will need to | ||
| login again. | ||
| * The new "session_forced_logout_timeout" option has been added to the | ||
| config.php. It's disabled by default, and setting a positive (non-zero) value | ||
| will enable the feature. If it's enabled, the passphrase cookie will expire | ||
| after those number of seconds pass, when the tab or the browser closes. | ||
| This will force the user to login again. | ||
|
|
||
| https://github.com/owncloud/core/pull/39916 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1119,6 +1119,7 @@ public function logout() { | |
| $this->setUser(null); | ||
| $this->setLoginName(null); | ||
| $this->unsetMagicInCookie(); | ||
| OC::$server->getSessionCryptoWrapper()->deleteCookie(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do not want to be picky, but might need to go to constructor.. I know this would cause massive changes chain.. your call
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll leave it there for now. I agree the service should be injected, but it isn't the only one. In addition, the class has a bunch of dependencies already, so we might need to consider a |
||
| $this->session->clear(); | ||
| $this->manager->emit('\OC\User', 'postLogout'); | ||
| return true; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wonder why this part was done in constructor in the past