]> granicus.if.org Git - apache/commitdiff
mod_session: When we have a session we were unable to decode, behave as if there...
authorGraham Leggett <minfrin@apache.org>
Fri, 24 Jan 2014 13:02:42 +0000 (13:02 +0000)
committerGraham Leggett <minfrin@apache.org>
Fri, 24 Jan 2014 13:02:42 +0000 (13:02 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1560977 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/session/mod_session.c

diff --git a/CHANGES b/CHANGES
index e6cd0ffc706e468eef2fe638732c56e877b02716..ed6b7917dc28124565897ebf3db4de98f3af38f1 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_session: When we have a session we were unable to decode,
+     behave as if there was no session at all. [Thomas Eckert
+     <thomas.r.w.eckert gmail com>]
+
   *) mod_session: Fix problems interpreting the SessionInclude and
      SessionExclude configuration. PR 56038. [Erik Pearson
      <erik adaptations.com>]
index 48475c0725c0a476baa2b477c14ff7294dff6918..0b472a240e01c93985e128549ae32e3c6a3211d7 100644 (file)
@@ -126,22 +126,28 @@ static apr_status_t ap_session_load(request_rec * r, session_rec ** z)
 
     /* found a session that hasn't expired? */
     now = apr_time_now();
-    if (!zz || (zz->expiry && zz->expiry < now)) {
+    if (zz) {
+        if (zz->expiry && zz->expiry < now) {
+            zz = NULL;
+        }
+        else {
+            /* having a session we cannot decode is just as good as having
+               none at all */
+            rv = ap_run_session_decode(r, zz);
+            if (OK != rv) {
+                ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01817)
+                              "error while decoding the session, "
+                              "session not loaded: %s", r->uri);
+                zz = NULL;
+            }
+        }
+    }
 
-        /* no luck, create a blank session */
+    /* no luck, create a blank session */
+    if (!zz) {
         zz = (session_rec *) apr_pcalloc(r->pool, sizeof(session_rec));
         zz->pool = r->pool;
         zz->entries = apr_table_make(zz->pool, 10);
-
-    }
-    else {
-        rv = ap_run_session_decode(r, zz);
-        if (OK != rv) {
-            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01817)
-                          "error while decoding the session, "
-                          "session not loaded: %s", r->uri);
-            return rv;
-        }
     }
 
     /* make sure the expiry and maxage are set, if present */