Commit e2f92664 authored by Ruediger Pluem's avatar Ruediger Pluem
Browse files

* Offer the possibility to create session cookies in the case a path is

  given.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@664333 13f79535-47bb-0310-9956-ffa450edef68
parent ab2ba4d3
Loading
Loading
Loading
Loading
+2 −1
Changes for docs/manual/mod/mod_rewrite.xml: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -1257,7 +1257,8 @@ cannot use <code>$N</code> in the substitution string!
        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', the optional <em>lifetime</em>
        is the lifetime of the cookie in minutes, and the optional 
        is the lifetime of the cookie in minutes (0 means expires at end
        of session), and the optional
        <em>path</em> is the path of the cookie. If <em>secure</em>
        is set to 'secure', 'true' or '1', the cookie is only transmitted via secured
        connections. If <em>httponly</em> is set to 'HttpOnly', 'true' or '1', the
+10 −3
Changes for modules/mappers/mod_rewrite.c: 10 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -2475,8 +2475,12 @@ static void add_cookie(request_rec *r, char *s)

            if (expires) {
                apr_time_exp_t tms;
                long exp_min;

                exp_min = atol(expires);
                if (exp_min) {
                    apr_time_exp_gmt(&tms, r->request_time
                                     + apr_time_from_sec((60 * atol(expires))));
                                     + apr_time_from_sec((60 * exp_min)));
                    exp_time = apr_psprintf(r->pool, "%s, %.2d-%s-%.4d "
                                                     "%.2d:%.2d:%.2d GMT",
                                           apr_day_snames[tms.tm_wday],
@@ -2485,13 +2489,16 @@ static void add_cookie(request_rec *r, char *s)
                                           tms.tm_year+1900,
                                           tms.tm_hour, tms.tm_min, tms.tm_sec);
                }
            }

            cookie = apr_pstrcat(rmain->pool,
                                 var, "=", val,
                                 "; path=", path ? path : "/",
                                 "; domain=", domain,
                                 expires ? "; expires=" : NULL,
                                 expires ? exp_time : NULL,
                                 expires ? (exp_time ? "; expires=" : "")
                                 : NULL,
                                 expires ? (exp_time ? exp_time : "")
                                 : NULL,
                                 (secure && (!strcasecmp(secure, "true")
                                             || !strcmp(secure, "1")
                                             || !strcasecmp(secure,