7f6d46
--- a/modules/session/mod_session.c	2018/02/16 13:39:47	1824476
7f6d46
+++ b/modules/session/mod_session.c	2018/02/16 13:41:31	1824477
7f6d46
@@ -510,12 +510,15 @@
7f6d46
      */
7f6d46
     ap_session_load(r, &z);
7f6d46
 
7f6d46
-    if (z && conf->env) {
7f6d46
-        session_identity_encode(r, z);
7f6d46
-        if (z->encoded) {
7f6d46
-            apr_table_set(r->subprocess_env, HTTP_SESSION, z->encoded);
7f6d46
-            z->encoded = NULL;
7f6d46
+    if (conf->env) {
7f6d46
+        if (z) {
7f6d46
+            session_identity_encode(r, z);
7f6d46
+            if (z->encoded) {
7f6d46
+                apr_table_set(r->subprocess_env, HTTP_SESSION, z->encoded);
7f6d46
+                z->encoded = NULL;
7f6d46
+            }
7f6d46
         }
7f6d46
+        apr_table_unset(r->headers_in, "Session");
7f6d46
     }
7f6d46
 
7f6d46
     return OK;