summaryrefslogtreecommitdiff
path: root/modules/session
diff options
context:
space:
mode:
authorGraham Leggett <minfrin@apache.org>2013-10-13 13:07:19 +0000
committerGraham Leggett <minfrin@apache.org>2013-10-13 13:07:19 +0000
commitc8b1ad8f55c8d45b48325d47b54a37d8f504eaa6 (patch)
tree8b5a460b7da3fbf02f189d921991284ff894ad2f /modules/session
parent0d9b5c81a5bcf670283f562d9428f1f56a5e7d2d (diff)
downloadhttpd-c8b1ad8f55c8d45b48325d47b54a37d8f504eaa6.tar.gz
mod_session: Reset the max-age on session save. PR 47476.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1531683 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/session')
-rw-r--r--modules/session/mod_session.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/modules/session/mod_session.c b/modules/session/mod_session.c
index 5a8ca4d8cb..89c80747cf 100644
--- a/modules/session/mod_session.c
+++ b/modules/session/mod_session.c
@@ -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) {