diff Lib/IMPL/Web/HttpResponse.pm @ 239:23daf2fae33a

*security subsytem bugfixes *HttpResponse: cookies which values are set to undefined will be deleted from browser
author sergey
date Tue, 16 Oct 2012 20:14:11 +0400
parents 6d8092d8ce1b
children 7c517134c42f
line wrap: on
line diff
--- a/Lib/IMPL/Web/HttpResponse.pm	Tue Oct 16 01:33:06 2012 +0400
+++ b/Lib/IMPL/Web/HttpResponse.pm	Tue Oct 16 20:14:11 2012 +0400
@@ -61,7 +61,12 @@
 
 #used to map a pair name valie to a valid cookie object
 sub _createCookie {
-    return UNIVERSAL::isa($_[1], 'CGI::Cookie') ? $_[1] : CGI::Cookie->new(-name => $_[0], -value => $_[1] );
+    return UNIVERSAL::isa($_[1], 'CGI::Cookie')
+        ? $_[1]
+        : ( defined $_[1]
+            ? CGI::Cookie->new(-name => $_[0], -value => $_[1] )
+            : CGI::Cookie->new(-name => $_[0], -expires => '-1d', -value => '')
+        );
 }
 
 sub InternalError {