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
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>
char *val;
char *domain;
char *expires;
+ char *path;
char *tok_cntx;
char *cookie;
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 */
var,
"=",
val,
- "; path=/; domain=",
+ "; path=",
+ (path)? path : "/",
+ "; domain=",
domain,
(expires)? "; expires=" : NULL,
(expires)?