Skip to content

mod_session_cookie: Keep the loaded session with SessionCookieRemove On [2.4.x] - #1083

Merged
arturobernalg merged 1 commit into
apache:2.4.xfrom
arturobernalg:backport/httpd-70376-session-cookie-remove
Nov 26, 2026
Merged

arturobernalg merged 1 commit into
apache:2.4.xfrom
arturobernalg:backport/httpd-70376-session-cookie-remove

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

Backport of #1080 (87b7986 on trunk) to 2.4.x.

Since the CVE-2026-47360 fix, a mod_auth_form login with SessionCookieRemove On answers with no Set-Cookie. The session_cookie_load() code is the same on 2.4.x, so the patch applies as is.

2.4.x has no test/modules/session yet, so this adds the package from trunk (without test_001, which covers a trunk-only feature) plus test_002. The /form-remove/ case fails on 2.4.x without the fix and passes with it.

BZ: https://bz.apache.org/bugzilla/show_bug.cgi?id=70376


  • This PR does not report or address a security vulnerability
    (see SECURITY.md and
    https://www.apache.org/security/#reporting-a-vulnerability).
  • Code follows the httpd style guide.
  • New log messages (level debug or higher) use an empty APLOGNO() tag;
    numbers are assigned by a committer at merge time (see docs/log-message-tags/README).
  • If the change is user-visible, a changes-entries/*.txt file is included,
    following the template in README.CHANGES (not needed otherwise).
  • Test cases based on pyhttpd are included where appropriate, in the
    test/modules/xxx directory matching the modules/xxx module source,
    or test/modules/core for core server changes. On Unix, verify these
    pass locally with e.g. make check-pytest PYTEST_DIRS=test/modules/xxx.

…On (apache#1080)

mod_session_cookie: Keep the loaded session with SessionCookieRemove On.

Since r1938655 a second session load with SessionCookieRemove On
dropped the session cached in the request notes and parsed the cookie
again, which the first load had already removed. Changes made to the
session in between were lost, so a mod_auth_form login answered with
no Set-Cookie. Reuse the cached session and only remove the cookie
from the current request's headers.

PR 70376

(cherry picked from commit 87b7986)
@arturobernalg
arturobernalg merged commit dcabaef into apache:2.4.x Nov 26, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants