Description: fix mod_session header manipulation
Origin: upstream, https://svn.apache.org/viewvc?view=revision&revision=1824477

Index: apache2-2.4.29/modules/session/mod_session.c
===================================================================
--- apache2-2.4.29.orig/modules/session/mod_session.c	2016-11-14 06:15:08.000000000 -0500
+++ apache2-2.4.29/modules/session/mod_session.c	2018-04-18 09:15:12.551256243 -0400
@@ -510,12 +510,15 @@ static int session_fixups(request_rec *
      */
     ap_session_load(r, &z);
 
-    if (z && conf->env) {
-        session_identity_encode(r, z);
-        if (z->encoded) {
-            apr_table_set(r->subprocess_env, HTTP_SESSION, z->encoded);
-            z->encoded = NULL;
+    if (conf->env) {
+        if (z) {
+            session_identity_encode(r, z);
+            if (z->encoded) {
+                apr_table_set(r->subprocess_env, HTTP_SESSION, z->encoded);
+                z->encoded = NULL;
+            }
         }
+        apr_table_unset(r->headers_in, "Session");
     }
 
     return OK;
