httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r664333 - in /httpd/httpd/trunk: docs/manual/mod/mod_rewrite.xml modules/mappers/mod_rewrite.c
Date Sat, 07 Jun 2008 12:50:04 GMT
Author: rpluem
Date: Sat Jun  7 05:50:04 2008
New Revision: 664333

URL: http://svn.apache.org/viewvc?rev=664333&view=rev
Log:
* Offer the possibility to create session cookies in the case a path is
  given.

Modified:
    httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml
    httpd/httpd/trunk/modules/mappers/mod_rewrite.c

Modified: httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml?rev=664333&r1=664332&r2=664333&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_rewrite.xml Sat Jun  7 05:50:04 2008
@@ -1257,7 +1257,8 @@
         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

Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_rewrite.c?rev=664333&r1=664332&r2=664333&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_rewrite.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Sat Jun  7 05:50:04 2008
@@ -2475,23 +2475,30 @@
 
             if (expires) {
                 apr_time_exp_t tms;
-                apr_time_exp_gmt(&tms, r->request_time
-                                     + apr_time_from_sec((60 * atol(expires))));
-                exp_time = apr_psprintf(r->pool, "%s, %.2d-%s-%.4d "
-                                                 "%.2d:%.2d:%.2d GMT",
-                                        apr_day_snames[tms.tm_wday],
-                                        tms.tm_mday,
-                                        apr_month_snames[tms.tm_mon],
-                                        tms.tm_year+1900,
-                                        tms.tm_hour, tms.tm_min, tms.tm_sec);
+                long exp_min;
+
+                exp_min = atol(expires);
+                if (exp_min) {
+                    apr_time_exp_gmt(&tms, r->request_time
+                                     + 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],
+                                           tms.tm_mday,
+                                           apr_month_snames[tms.tm_mon],
+                                           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,



Mime
View raw message