From 43a7f6f8094c3af1e56549800cce92fc45fb8d44 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Mon, 19 May 2014 21:22:24 -0700 Subject: [PATCH] Sometimes there is no space before a cookie http://virtualmin.com/node/33174 --- miniserv.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/miniserv.pl b/miniserv.pl index 84c35d2ee..c8ebe3f54 100755 --- a/miniserv.pl +++ b/miniserv.pl @@ -1664,7 +1664,7 @@ if ($config{'userfile'}) { # Check for a visit to the special session login page if ($config{'session'} && !$deny_authentication && $page eq $config{'session_login'}) { - if ($in{'logout'} && $header{'cookie'} =~ /(^|\s)$sidname=([a-f0-9]+)/) { + if ($in{'logout'} && $header{'cookie'} =~ /(^|\s|;)$sidname=([a-f0-9]+)/) { # Logout clicked .. remove the session local $sid = $2; print $PASSINw "delete $sid\n"; @@ -1798,10 +1798,10 @@ if ($config{'userfile'}) { $validated = 1; } elsif (!$deny_authentication && - $header{'cookie'} =~ /(^|\s)$sidname=([a-f0-9]+)/) { + $header{'cookie'} =~ /(^|\s|;)$sidname=([a-f0-9]+)/) { # Try all session cookies local $cookie = $header{'cookie'}; - while($cookie =~ s/(^|\s)$sidname=([a-f0-9]+)//) { + while($cookie =~ s/(^|\s|;)$sidname=([a-f0-9]+)//) { $session_id = $2; local $notimeout = $in{'webmin_notimeout'} ? 1 : 0;