]> granicus.if.org Git - apache/commitdiff
Fix the method used to detect the root of the request tree when subrequests
authorGraham Leggett <minfrin@apache.org>
Wed, 7 May 2008 15:03:58 +0000 (15:03 +0000)
committerGraham Leggett <minfrin@apache.org>
Wed, 7 May 2008 15:03:58 +0000 (15:03 +0000)
are present.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@654137 13f79535-47bb-0310-9956-ffa450edef68

modules/session/mod_session_cookie.c

index 0eb0e597d4a4fc4881ecc986eac2b0d1cff3094c..8354537406baf9ea7bdf8f08fb833083ae1d65e0 100644 (file)
@@ -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) {