]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_session_cookie: avoid adding the Set-Cookie header
authorLuca Toscano <elukey@apache.org>
Tue, 9 Oct 2018 12:29:08 +0000 (12:29 +0000)
committerLuca Toscano <elukey@apache.org>
Tue, 9 Oct 2018 12:29:08 +0000 (12:29 +0000)
                    in both r->headers_out and r->err_headers_out
                    to avoid duplication.

In session_cookie_save it seems that ap_cookie_write is called
with r->headers_out and r->err_headers_out, ending up in the same
Set-Cookie header on both tables and eventually duplicated in the
HTTP response. I took Emmanuel's patch and trimmed out the bits
that remove the header only from r->err_headers_out (leaving it
to do the work on both tables) as attempt to change this bit of code
in the most conservative way as possible. Sending a commit for
a broader review.

PR: 60910,56098,55278

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1843244 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/session/mod_session_cookie.c

diff --git a/CHANGES b/CHANGES
index 2758c7c235c4f209f9f628b94fcf77ddb2004ef7..04d604abc740659890a9c7804f8c9a5a6db85207 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.1
 
+  *) mod_session_cookie: avoid duplicate Set-Cookie header in the response.
+     [Emmanuel Dreyfus <manu@netbsd.org>, Luca Toscano]
+
   *) mod_dav_fs: Set a default DAVLockDB within the state directory.
      [Joe Orton]
 
index 4aa75e483515bf78c7aeb4f9bdbc878e73dd45f3..36168b7ead7727826e65b184b16285b7f63b7a39 100644 (file)
@@ -64,7 +64,7 @@ static apr_status_t session_cookie_save(request_rec * r, session_rec * z)
     if (conf->name_set) {
         if (z->encoded && z->encoded[0]) {
             ap_cookie_write(r, conf->name, z->encoded, conf->name_attrs,
-                            z->maxage, r->headers_out, r->err_headers_out,
+                            z->maxage, r->err_headers_out,
                             NULL);
         }
         else {
@@ -77,7 +77,7 @@ static apr_status_t session_cookie_save(request_rec * r, session_rec * z)
     if (conf->name2_set) {
         if (z->encoded && z->encoded[0]) {
             ap_cookie_write2(r, conf->name2, z->encoded, conf->name2_attrs,
-                             z->maxage, r->headers_out, r->err_headers_out,
+                             z->maxage, r->err_headers_out,
                              NULL);
         }
         else {