]> granicus.if.org Git - apache/commitdiff
new option 'path' to the cookie
authorIan Holsman <ianh@apache.org>
Thu, 29 Aug 2002 23:14:52 +0000 (23:14 +0000)
committerIan Holsman <ianh@apache.org>
Thu, 29 Aug 2002 23:14:52 +0000 (23:14 +0000)
PR: 12172

Submitted by: apachecvslog@robcromwell.com (Rob Cromwell)

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

CHANGES
docs/manual/mod/mod_rewrite.xml
modules/mappers/mod_rewrite.c

diff --git a/CHANGES b/CHANGES
index cc00f63c74c6c89ef781e17017603ea72b3e8482..1ca195a65c9e97a480677fd881a3cae0563ea942 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,8 @@
 Changes with Apache 2.0.41
 
-  *) mod_rewrite can now sets cookies in err_headers, and uses the correct
-     expiry date. PR 12132 
+  *) mod_rewrite can now sets cookies in err_headers, uses the correct
+     expiry date, and can now set the path as well
+     PR 12132,12181,12172.
      [Ian Holsman / Rob Cromwell <apachechangelog@robcromwell.com>]
 
   *) The content-length filter no longer tries to buffer up
index b2334554ece55ec54c968d8c78c247e30ebd2f10..8e6afcdbaed6e317ededbac9bbc84732f227120b 100644 (file)
@@ -1611,13 +1611,14 @@ There is a special feature:
         information from URLs.</li>
 
         <li>
-        '<strong><code>cookie|CO=</code></strong><em>NAME</em>:<em>VAL</em>:<em>domain</em>[:<em>lifetime</em>]'
+               '<strong><code>cookie|CO=</code></strong><em>NAME</em>:<em>VAL</em>:<em>domain</em>[:<em>lifetime</em>[:<em>path</em>]]'
         (set <strong>co</strong>cookie)<br />
         This sets a cookie on the client's browser.  The cookie's name
         is specified by <em>NAME</em> and the value is
         <em>VAL</em>. The <em>domain</em> field is the domain of the
-        cookie, such as '.apache.org' and the optional <em>lifetime</em>
-        is the lifetime of the cookie in minutes.</li>
+        cookie, such as '.apache.org',the optional <em>lifetime</em>
+       is the lifetime of the cookie in minutes, and the optional 
+       <em>path</em> is the path of the cookie</li>
  
       </ul>
 
index c9b918669e9703321d98dbaa2e03b7fce0fbbb71..c39ae6de4121196b7737dc2a2321b21034d67fba 100644 (file)
@@ -4134,6 +4134,7 @@ static void add_cookie(request_rec *r, char *s)
     char *val;
     char *domain;
     char *expires;
+    char *path;
 
     char *tok_cntx;
     char *cookie;
@@ -4144,6 +4145,12 @@ static void add_cookie(request_rec *r, char *s)
         domain = apr_strtok(NULL, ":", &tok_cntx);
         /** the line below won't hit the token ever **/
         expires = apr_strtok(NULL, ":", &tok_cntx); 
+        if (expires) {
+            path = apr_strtok(NULL,":", &tok_cntx);
+        }
+        else {
+            path = NULL;
+        }
 
         if (var && val && domain) {
             /* FIX: use cached time similar to how logging does it */
@@ -4161,7 +4168,9 @@ static void add_cookie(request_rec *r, char *s)
                                     var,
                                     "=",
                                     val,
-                                    "; path=/; domain=",
+                                    "; path=",
+                                    (path)? path : "/",
+                                    "; domain=",
                                     domain,
                                     (expires)? "; expires=" : NULL,
                                     (expires)?