Currently, when setting a cookie using the cookie|CO RewriteRule flag there is no ability to specify the path of the cookie. 'cookie|CO=NAME:VAL:domain[:lifetime]' (set cocookie) I suggest adding a second optional parameter to specify the path of the cookie. By adding it as an optional parameter, there won't be any conflicts with existing cookie RewriteRules. 'cookie|CO=NAME:VAL:domain[:lifetime][:path]' (set cocookie) I've modified the add_cookie function below to work with the new path field. ======================================================================= static void add_cookie(request_rec *r, char *s) { char *var; char *val; char *domain; char *expires; char *path; char *tok_cntx; char *cookie; if (s) { var = apr_strtok(s, ":", &tok_cntx); val = apr_strtok(NULL, ":", &tok_cntx); domain = apr_strtok(NULL, ":", &tok_cntx); expires = apr_strtok(NULL, ":", &tok_cntx); path = apr_strtok(NULL, ":", &tok_cntx); if (var && val && domain) { /* FIX: use cached time similar to how logging does it */ cookie = apr_pstrcat( r->pool, var, "=", val, "; path=", (path)? path : "/", "; domain=", domain, (expires)? "; expires=" : NULL, (expires)? ap_ht_time(r->pool, r->request_time + apr_time_from_sec(60 * atol(expires)), "%a, %d-%b-%Y %T GMT", 1) : NULL, NULL); /* * XXX: should we add it to err_headers_out as well ? * if we do we need to be careful that only ONE gets sent out */ apr_table_add(r->headers_out, "Set-Cookie", cookie); rewritelog(r, 5, "setting cookie '%s' to '%s'", var, val); } } }
Not sure why I'm cc'ed here. Remove it and note that a fix is proposed in the bug.
Thanks once again Rob. for my sanity, can you mention the other bugs you have open on the same piece of functionality ;-) save me 3 seperate commits
Works great! Sorry for the trouble :\
just me bitching.. take no heed