httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r690400 - in /httpd/httpd/trunk: CHANGES include/util_cookies.h modules/session/mod_session_cookie.c server/util_cookies.c
Date Fri, 29 Aug 2008 21:49:27 GMT
Author: minfrin
Date: Fri Aug 29 14:49:27 2008
New Revision: 690400

URL: http://svn.apache.org/viewvc?rev=690400&view=rev
Log:
mod_session_cookie: Make sure that cookie attributes are correctly
included in the blank cookie when cookies are removed. This fixes an
inability to log out when using mod_auth_form.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/include/util_cookies.h
    httpd/httpd/trunk/modules/session/mod_session_cookie.c
    httpd/httpd/trunk/server/util_cookies.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=690400&r1=690399&r2=690400&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Fri Aug 29 14:49:27 2008
@@ -2,6 +2,10 @@
 Changes with Apache 2.3.0
 [ When backported to 2.2.x, remove entry from this file ]
 
+  *) mod_session_cookie: Make sure that cookie attributes are correctly
+     included in the blank cookie when cookies are removed. This fixes an
+     inability to log out when using mod_auth_form. [Graham Leggett]
+
   *) mod_autoindex: add configuration option to insert string
      in HTML HEAD. [Nick Kew]
 

Modified: httpd/httpd/trunk/include/util_cookies.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/util_cookies.h?rev=690400&r1=690399&r2=690400&view=diff
==============================================================================
--- httpd/httpd/trunk/include/util_cookies.h (original)
+++ httpd/httpd/trunk/include/util_cookies.h Fri Aug 29 14:49:27 2008
@@ -82,16 +82,20 @@
  *
  * @param r The request
  * @param name The name of the cookie.
+ * @param attrs The string containing additional cookie attributes. If NULL, the
+ *              CLEAR_ATTRS will be used.
  */
-AP_DECLARE(apr_status_t) ap_cookie_remove(request_rec * r, const char *name);
+AP_DECLARE(apr_status_t) ap_cookie_remove(request_rec * r, const char *name, const char *attrs);
 
 /**
  * Remove an RFC2965 compliant cookie.
  *
  * @param r The request
  * @param name2 The name of the cookie.
+ * @param attrs2 The string containing additional cookie attributes. If NULL, the
+ *               CLEAR_ATTRS will be used.
  */
-AP_DECLARE(apr_status_t) ap_cookie_remove2(request_rec * r, const char *name2);
+AP_DECLARE(apr_status_t) ap_cookie_remove2(request_rec * r, const char *name2, const char
*attrs2);
 
 /**
  * Read a cookie called name, placing its value in val.

Modified: httpd/httpd/trunk/modules/session/mod_session_cookie.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/session/mod_session_cookie.c?rev=690400&r1=690399&r2=690400&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/session/mod_session_cookie.c (original)
+++ httpd/httpd/trunk/modules/session/mod_session_cookie.c Fri Aug 29 14:49:27 2008
@@ -70,7 +70,7 @@
             ap_cookie_write(r, conf->name, z->encoded, conf->name_attrs, z->maxage);
         }
         else {
-            ap_cookie_remove(r, conf->name);
+            ap_cookie_remove(r, conf->name, conf->name_attrs);
         }
     }
 
@@ -80,7 +80,7 @@
             ap_cookie_write2(r, conf->name2, z->encoded, conf->name2_attrs, z->maxage);
         }
         else {
-            ap_cookie_remove2(r, conf->name2);
+            ap_cookie_remove2(r, conf->name2, conf->name2_attrs);
         }
     }
 

Modified: httpd/httpd/trunk/server/util_cookies.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_cookies.c?rev=690400&r1=690399&r2=690400&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_cookies.c (original)
+++ httpd/httpd/trunk/server/util_cookies.c Fri Aug 29 14:49:27 2008
@@ -99,12 +99,12 @@
  * @param r The request
  * @param name The name of the cookie.
  */
-AP_DECLARE(apr_status_t) ap_cookie_remove(request_rec * r, const char *name)
+AP_DECLARE(apr_status_t) ap_cookie_remove(request_rec * r, const char *name, const char *attrs)
 {
 
     /* create RFC2109 compliant cookie */
     char *rfc2109 = apr_pstrcat(r->pool, name, "=;",
-                                CLEAR_ATTRS, NULL);
+                                attrs ? attrs : CLEAR_ATTRS, NULL);
     ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, LOG_PREFIX
                   "user '%s' removed cookie: '%s'", r->user, rfc2109);
     apr_table_addn(r->headers_out, SET_COOKIE, rfc2109);
@@ -119,12 +119,12 @@
  * @param r The request
  * @param name2 The name of the cookie.
  */
-AP_DECLARE(apr_status_t) ap_cookie_remove2(request_rec * r, const char *name2)
+AP_DECLARE(apr_status_t) ap_cookie_remove2(request_rec * r, const char *name2, const char
*attrs2)
 {
 
     /* create RFC2965 compliant cookie */
     char *rfc2965 = apr_pstrcat(r->pool, name2, "=;",
-                                CLEAR_ATTRS, NULL);
+                                attrs2 ? attrs2 : CLEAR_ATTRS, NULL);
     ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, LOG_PREFIX
                   "user '%s' removed cookie2: '%s'", r->user, rfc2965);
     apr_table_addn(r->headers_out, SET_COOKIE2, rfc2965);



Mime
View raw message