[stable34] fix(auth): keep remember-me cookies pointing at a live session token - #64650
Merged
Merged
Conversation
backportbot
Bot
requested review from
icewind1991,
provokateurin and
solracsf
September 22, 2026 11:22
fix(auth): keep remember-me cookies pointing at a live session token The remember-me cookie outlives the session token it refers to in two cases, and cookie login then fails on every request. A session token created as DO_NOT_REMEMBER (user_oidc, Apache login) is removed by the cleanup job after session_lifetime, while the cookies last remember_login_cookie_lifetime. loginWithApache() now creates its token as REMEMBER, and createRememberMeToken() marks a DO_NOT_REMEMBER token as REMEMBER for other callers with the same mismatch. ISession::regenerateId(true, true) moves the token to the new session id but left nc_session_id pointing at the old one (password protected share unlock, Talk password rooms). The cookie is now rewritten with the new id. Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
solracsf
force-pushed
the
backport/64572/stable34
branch
from
September 22, 2026 13:27
dd5e049 to
38b6479
Compare
loginWithApache() sets remember-me cookies but created the session token as DO_NOT_REMEMBER, so the cleanup job removed it after session_lifetime while the cookie stayed valid, matching the mismatch fixed for the share-unlock case in the previous commit. Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
solracsf
marked this pull request as ready for review
September 22, 2026 14:22
solracsf
requested review from
come-nc and
leftybournes
and removed request for
a team
September 22, 2026 14:22
solracsf
enabled auto-merge
September 22, 2026 16:51
solracsf
approved these changes
Sep 22, 2026
icewind1991
approved these changes
Sep 23, 2026
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.
Backport of #64572
Todo
Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.