Obsolete experiment
[mkws-moved-to-github.git] / etc / mod_perl / MyApache2 / CopyCookie.pm
index 86e9b69..3e29647 100644 (file)
@@ -10,7 +10,6 @@ use constant BUFF_LEN => 1024;
 
 sub handler {
     my $f = shift;
-    warn "in MyApache2::CopyCookie (f=$f)";
 
     # If the server generated a new cookie, make it available in a
     # header other than the magic "Cookie" that clients can't read.
@@ -26,8 +25,10 @@ sub handler {
     $cookie = $hi->get('Cookie');
     if (!defined $cookie || $cookie eq "") {
        $cookie = $hi->get('X-Cake');
-       warn "copying X-Cake '$cookie' to Cookie";
-       $hi->set('Cookie', $cookie);
+       if (defined $cookie && $cookie ne "") {
+           warn "copying X-Cake '$cookie' to Cookie";
+           $hi->set('Cookie', $cookie);
+       }
     }
 
     while ($f->read(my $buffer, BUFF_LEN)) {