]> granicus.if.org Git - apache/commitdiff
mod_session: Reset the max-age on session save. PR 47476.
authorGraham Leggett <minfrin@apache.org>
Sun, 13 Oct 2013 13:07:19 +0000 (13:07 +0000)
committerGraham Leggett <minfrin@apache.org>
Sun, 13 Oct 2013 13:07:19 +0000 (13:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1531683 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/session/mod_session.c

diff --git a/CHANGES b/CHANGES
index 0c583f9e14b94c80f22740499fc8309e0a9492c6..5914b5123d4bd0f2162ffb3d73c8a320a072c3f5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_session: Reset the max-age on session save. PR 47476. [Alexey
+     Varlamov <alexey.v.varlamov gmail com>]
+
   *) mod_session: After parsing the value of the header specified by the
      SessionHeader directive, remove the value from the response. PR 55279.
      [Graham Leggett]
index 5a8ca4d8cb9008f0afb429d0042505f3a9b350c0..89c80747cf4b8ec9892ae38156a02ce9bdebaca9 100644 (file)
@@ -144,9 +144,11 @@ static apr_status_t ap_session_load(request_rec * r, session_rec ** z)
         }
     }
 
-    /* make sure the expiry is set, if present */
-    if (!zz->expiry && dconf->maxage) {
-        zz->expiry = now + dconf->maxage * APR_USEC_PER_SEC;
+    /* make sure the expiry and maxage are set, if present */
+    if (dconf->maxage) {
+        if (!zz->expiry) {
+            zz->expiry = now + dconf->maxage * APR_USEC_PER_SEC;
+        }
         zz->maxage = dconf->maxage;
     }
 
@@ -194,6 +196,11 @@ static apr_status_t ap_session_save(request_rec * r, session_rec * z)
             z->maxage = dconf->maxage;
         }
 
+        /* reset the expiry before saving if present */
+        if (z->dirty && z->maxage) {
+            z->expiry = now + z->maxage * APR_USEC_PER_SEC;
+        } 
+
         /* encode the session */
         rv = ap_run_session_encode(r, z);
         if (OK != rv) {