Repository navigation
fix(session): Keep remembered logins across the session timeout - #65959
Open
DerDreschner wants to merge 1 commit into
Open
DerDreschner wants to merge 1 commit into
DerDreschner wants to merge 1 commit into
Conversation
DerDreschner
requested review from
Altahrim,
provokateurin and
sorbaugh
and removed request for
a team
October 27, 2026 09:48
DerDreschner
force-pushed
the
fix/session-timeout-issues
branch
2 times, most recently
from
October 27, 2026 10:15
4b3ea84 to
d808057
Compare
DerDreschner
enabled stacked auto-merge
October 27, 2026 10:48
DerDreschner
force-pushed
the
fix/session-timeout-issues
branch
4 times, most recently
from
October 28, 2026 09:19
3b69c65 to
6a8713f
Compare
5 of 7 tasks
DerDreschner
force-pushed
the
fix/session-timeout-issues
branch
from
November 5, 2026 18:17
6a8713f to
b58a3cc
Compare
DerDreschner
marked this pull request as draft
November 5, 2026 18:53
stacked auto-merge was automatically disabled
November 5, 2026 18:53
Pull request was converted to draft
DerDreschner
force-pushed
the
fix/session-timeout-issues
branch
from
November 6, 2026 08:43
b58a3cc to
7ee6061
Compare
DerDreschner
marked this pull request as ready for review
November 6, 2026 08:44
DerDreschner
enabled stacked auto-merge
November 6, 2026 08:44
Member
Author
|
/backport to stable35 |
Member
Author
|
/backport to stable34 |
Member
Author
|
/backport to stable33 |
DerDreschner
force-pushed
the
fix/session-timeout-issues
branch
from
November 6, 2026 10:17
7ee6061 to
626eed5
Compare
Contributor
|
Non-blocking question: could |
pringelmann
approved these changes
Nov 6, 2026
DerDreschner
disabled stacked auto-merge
November 6, 2026 10:50
Member
Author
|
@pringelmann: Yeah, that works and is a good idea. I'll change it. |
A session that was idle for longer than session_lifetime is ended with a full logout, which also deletes the remember-me cookies. The user is logged out for good, although they asked to stay logged in and the documentation of session_lifetime says a remembered login is transparently re-authenticated after the session expired. When the request carries remember-me cookies, endInactiveSession() now only drops the session data and keeps the cookies. The remember-me login then signs the user in again and replaces the remember-me token, as it does whenever the session is gone. Any other session is still ended with a logout. As this needs no database, it also applies in maintenance mode and with a pending upgrade, and the login continues once the instance is available again. The remember-me login is now only attempted with cookies that are strings, and loginWithCookie() requires strings. Unlocking a password-protected share only re-issues remember-me cookies that are strings. Clients can send the cookies as arrays, which ended in a TypeError. Assisted-by: ClaudeCode:claude-opus-5 Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: David Dreschner <david.dreschner@nextcloud.com>
DerDreschner
force-pushed
the
fix/session-timeout-issues
branch
from
November 6, 2026 13:14
626eed5 to
ca24630
Compare
4 of 7 tasks
Member
Author
|
@pringelmann Done! The second part is available as draft in #66416 now as well. |
come-nc
approved these changes
Nov 9, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The "Remember me" feature doesn't work correctly under some circumstances. One of them is that a session that was idle for longer than
session_lifetimeis ended with a full logout, which also deletes the cookies necessary for the "Remember me" feature. This contradicts the documentation forsession_lifetime, which states that users with "Remember me" may be transparently re-authenticated after the session expired, as long as the "Remember me" cookie remains valid:server/config/config.sample.php
Lines 394 to 396 in 5dfaf6c
This is changed with this PR. If the request carries "Remember me" cookies, only the session data is cleared and the cookies are kept, so the normal "Remember me" login signs the user in again with a new token, as it does whenever the session is gone. This needs no database, so it also works in maintenance mode or with a pending upgrade.
Checklist
3. to review, feature component)stable32)AI (if applicable)