85cb4d
diff --git a/modules/session/mod_session.c b/modules/session/mod_session.c
85cb4d
index 10e6396..7ee477c 100644
85cb4d
--- a/modules/session/mod_session.c
85cb4d
+++ b/modules/session/mod_session.c
85cb4d
@@ -126,20 +126,23 @@ static apr_status_t ap_session_load(request_rec * r, session_rec ** z)
85cb4d
 
85cb4d
     /* found a session that hasn't expired? */
85cb4d
     now = apr_time_now();
85cb4d
+
85cb4d
     if (zz) {
85cb4d
-        if (zz->expiry && zz->expiry < now) {
85cb4d
+        /* load the session attibutes */
85cb4d
+        rv = ap_run_session_decode(r, zz);
85cb4d
+ 
85cb4d
+        /* having a session we cannot decode is just as good as having
85cb4d
+           none at all */
85cb4d
+       if (OK != rv) {
85cb4d
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01817)
85cb4d
+                    "error while decoding the session, "
85cb4d
+                    "session not loaded: %s", r->uri);
85cb4d
             zz = NULL;
85cb4d
         }
85cb4d
-        else {
85cb4d
-            /* having a session we cannot decode is just as good as having
85cb4d
-               none at all */
85cb4d
-            rv = ap_run_session_decode(r, zz);
85cb4d
-            if (OK != rv) {
85cb4d
-                ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01817)
85cb4d
-                              "error while decoding the session, "
85cb4d
-                              "session not loaded: %s", r->uri);
85cb4d
-                zz = NULL;
85cb4d
-            }
85cb4d
+
85cb4d
+       /* invalidate session if session is expired */
85cb4d
+        if (zz && zz->expiry && zz->expiry < now) {
85cb4d
+            zz = NULL;
85cb4d
         }
85cb4d
     }
85cb4d