summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorRuediger Pluem <rpluem@apache.org>2008-04-12 10:44:36 +0200
committerRuediger Pluem <rpluem@apache.org>2008-04-12 10:44:36 +0200
commit93a75ba455053a96416ad2bd922c8072d84f1f8e (patch)
treeccb44b49f3147791b76c0553a573ed1a74273086 /modules
parentMove the KeptBodySize directive, kept_body filters and the (diff)
downloadapache2-93a75ba455053a96416ad2bd922c8072d84f1f8e.tar.xz
apache2-93a75ba455053a96416ad2bd922c8072d84f1f8e.zip
* Allow Cookie option to set secure and HttpOnly flags
PR: 44799 Submitted by: Christian Wenz <christian wenz.org> Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@647395 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r--modules/mappers/mod_rewrite.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c
index c490b5accd..4efd7cfa88 100644
--- a/modules/mappers/mod_rewrite.c
+++ b/modules/mappers/mod_rewrite.c
@@ -2444,6 +2444,8 @@ static void add_cookie(request_rec *r, char *s)
char *domain;
char *expires;
char *path;
+ char *secure;
+ char *httponly;
char *tok_cntx;
char *cookie;
@@ -2468,6 +2470,8 @@ static void add_cookie(request_rec *r, char *s)
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;
if (expires) {
apr_time_exp_t tms;
@@ -2488,6 +2492,8 @@ static void add_cookie(request_rec *r, char *s)
"; domain=", domain,
expires ? "; expires=" : NULL,
expires ? exp_time : NULL,
+ (strcasecmp(secure, "true") == 0 || strcasecmp(secure, "1") == 0) ? "; secure" : NULL,
+ httponly ? "; HttpOnly" : NULL,
NULL);
apr_table_addn(rmain->err_headers_out, "Set-Cookie", cookie);