-*- coding: utf-8 -*-
Changes with Apache 2.5.0
+ *) mod_rewrite: Allow cookies set by mod_rewrite to contain ':' by accepting
+ ';' as an alternate separator. PR47241.
+ [<bugzilla schermesser com>, Eric Covener]
+
*) apxs: Add HTTPD_VERSION and HTTPD_MMN to the variables available with
apxs -q. PR58202. [Daniel Shahaf <danielsh apache.org>]
[CO=NAME:VALUE:DOMAIN:lifetime:path:secure:httponly]
</example>
+<p>If a literal ':' character is needed in any of the cookie fields, an
+alternate syntax is available. To opt-in to the alternate syntax, the cookie
+"Name" should be preceded with a ';' character, and field separators should be
+specified as ';'.</p>
+
+<example>
+[CO=;NAME;VALUE:MOREVALUE;DOMAIN;lifetime;path;secure;httponly]
+</example>
+
<p>You must declare a name, a value, and a domain for the cookie to be set.</p>
<dl>
char *tok_cntx;
char *cookie;
+ /* long-standing default, but can't use ':' in a cookie */
+ const char *sep = ":";
- var = apr_strtok(s, ":", &tok_cntx);
- val = apr_strtok(NULL, ":", &tok_cntx);
- domain = apr_strtok(NULL, ":", &tok_cntx);
+ /* opt-in to ; separator if first character is a ; */
+ if (s && *s == ';') {
+ sep = ";";
+ s++;
+ }
+
+ var = apr_strtok(s, sep, &tok_cntx);
+ val = apr_strtok(NULL, sep, &tok_cntx);
+ domain = apr_strtok(NULL, sep, &tok_cntx);
if (var && val && domain) {
request_rec *rmain = r;
if (!data) {
char *exp_time = NULL;
- expires = apr_strtok(NULL, ":", &tok_cntx);
- path = expires ? apr_strtok(NULL, ":", &tok_cntx) : NULL;
- secure = path ? apr_strtok(NULL, ":", &tok_cntx) : NULL;
- httponly = secure ? apr_strtok(NULL, ":", &tok_cntx) : NULL;
+ expires = apr_strtok(NULL, sep, &tok_cntx);
+ path = expires ? apr_strtok(NULL, sep, &tok_cntx) : NULL;
+ secure = path ? apr_strtok(NULL, sep, &tok_cntx) : NULL;
+ httponly = secure ? apr_strtok(NULL, sep, &tok_cntx) : NULL;
if (expires) {
apr_time_exp_t tms;