From: Graham Leggett Date: Wed, 7 May 2008 15:03:58 +0000 (+0000) Subject: Fix the method used to detect the root of the request tree when subrequests X-Git-Tag: 2.3.0~666 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=679377d732c92f6022dd4b520750a7ee5c5c9c63;p=thirdparty%2Fapache%2Fhttpd.git Fix the method used to detect the root of the request tree when subrequests are present. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@654137 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/session/mod_session_cookie.c b/modules/session/mod_session_cookie.c index 0eb0e597d4a..8354537406b 100644 --- a/modules/session/mod_session_cookie.c +++ b/modules/session/mod_session_cookie.c @@ -117,7 +117,16 @@ AP_DECLARE(int) ap_session_cookie_load(request_rec * r, session_rec ** z) const char *val = NULL; const char *note = NULL; const char *name = NULL; - request_rec *m = r->main ? r->main : r; + request_rec *m = r; + + /* find the first redirect */ + while (m->prev) { + m = m->prev; + } + /* find the main request */ + while (m->main) { + m = m->main; + } /* is our session in a cookie? */ if (conf->name2_set) {