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 auto-merge
October 27, 2026 10:48
DerDreschner
force-pushed
the
fix/session-timeout-issues
branch
3 times, most recently
from
October 27, 2026 14:37
d9f5052 to
3b69c65
Compare
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. End such a session with endInactiveSession() instead: when the request carries valid remember-me cookies for the current session, only the session data is dropped, so the remember-me login signs the user in again. The cookies must belong to the user of the session token. No user backend is set up yet when a session times out, so the session token tells whose session it is. Any other request keeps being logged out as before. The remember-me login is now only attempted with cookies that are strings, and loginWithCookie() requires strings. Clients can send the cookies as arrays, which ended in a TypeError for nc_username and nc_session_id. 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
October 28, 2026 09:19
3b69c65 to
6a8713f
Compare
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 valid "Remember me" cookies for the current session, only the session data is cleared, so the "Remember me" login signs the user in again.
Checklist
3. to review, feature component)stable32)AI (if applicable)