From 140715a33667fbcae7477ebcc6288d708c6ba032 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Sat, 7 Jun 2008 12:29:27 +0000 Subject: [PATCH] * Allow HttpOnly, 1 and true to enable HttpOnly, allow secure, 1 and true to enable secure. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@664330 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/mod_rewrite.xml | 4 ++-- modules/mappers/mod_rewrite.c | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/manual/mod/mod_rewrite.xml b/docs/manual/mod/mod_rewrite.xml index c9e4fa0af1..2a66f4d331 100644 --- a/docs/manual/mod/mod_rewrite.xml +++ b/docs/manual/mod/mod_rewrite.xml @@ -1259,8 +1259,8 @@ cannot use $N in the substitution string! cookie, such as '.apache.org', the optional lifetime is the lifetime of the cookie in minutes, and the optional path is the path of the cookie. If secure - is set to 'true' or '1', the cookie is only transmitted via secured - connections. If httponly is set to 'true' or '1', the + is set to 'secure', 'true' or '1', the cookie is only transmitted via secured + connections. If httponly is set to 'HttpOnly', 'true' or '1', the HttpOnly flag is used, making the cookie inaccessible to JavaScript code on browsers that support this feature. diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 4abf898db6..10e50dd9bf 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -2493,10 +2493,14 @@ static void add_cookie(request_rec *r, char *s) expires ? "; expires=" : NULL, expires ? exp_time : NULL, (secure && (!strcasecmp(secure, "true") - || !strcasecmp(secure, "1"))) ? + || !strcmp(secure, "1") + || !strcasecmp(secure, + "secure"))) ? "; secure" : NULL, (httponly && (!strcasecmp(httponly, "true") - || !strcasecmp(httponly, "1"))) ? + || !strcmp(httponly, "1") + || !strcasecmp(httponly, + "HttpOnly"))) ? "; HttpOnly" : NULL, NULL); -- 2.40.0