From: Graham Leggett Date: Fri, 24 Jan 2014 13:02:42 +0000 (+0000) Subject: mod_session: When we have a session we were unable to decode, behave as if there... X-Git-Tag: 2.5.0-alpha~4610 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48ebde687bf51ad50ad74abb1828efeb7275ee78;p=apache mod_session: When we have a session we were unable to decode, behave as if there was no session at all. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1560977 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index e6cd0ffc70..ed6b7917dc 100644 --- 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 + ] + *) mod_session: Fix problems interpreting the SessionInclude and SessionExclude configuration. PR 56038. [Erik Pearson ] diff --git a/modules/session/mod_session.c b/modules/session/mod_session.c index 48475c0725..0b472a240e 100644 --- a/modules/session/mod_session.c +++ b/modules/session/mod_session.c @@ -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 */