From fa010f13984afcb3b49ad91b081300d67bdbe35b Mon Sep 17 00:00:00 2001 From: Rob van Son Date: Fri, 5 Apr 2013 10:51:08 +0200 Subject: [PATCH] Renamed $ENV{COOKIE_JAR} to $ENV{HTTP_COOKIE} in added support for CGI::Cookie, not tested --- CGIscriptor.pl | 11 ++++++----- CGIservlet.pl | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CGIscriptor.pl b/CGIscriptor.pl index 0b2e5a3..5bbeb46 100755 --- a/CGIscriptor.pl +++ b/CGIscriptor.pl @@ -61,7 +61,8 @@ ENDOFPREHELPTEXT1 ############################################################################ # # Changes (document ALL changes with date, name and email here): -# 05 Apr 2013 - Added support for CGI::Cookie (untested) +# 05 Apr 2013 - Renamed COOKIE_JAR to HTTP_COOKIE, added support for +# CGI::Cookie in case $ENV{HTTP_COOKIE} is undefined (untested) # 31 Mar 2013 - Added support for Digest::SHA # 13 Mar 2013 - Changed password hash # 10 Jul 2012 - Version 2.4 @@ -446,13 +447,13 @@ sub get_random_hex # () -> hex # Used to set cookies, only session cookies supported my %SETCOOKIELIST = (); my %CGI_Cookies = (); -# Get the cookies if $ENV{'COOKIE_JAR'} is not defined, use CGI::Cookie -# If it is available +# Parse the cookies if $ENV{'HTTP_COOKIE'} is defined, else use CGI::Cookie +# if it is available sub Get_All_Cookies { - if(defined($ENV{'COOKIE_JAR'})) + if(defined($ENV{'HTTP_COOKIE'})) { - my @CookieList = split(/[\;\s]+/, $ENV{'COOKIE_JAR'}); + my @CookieList = split(/[\;\s]+/, $ENV{'HTTP_COOKIE'}); foreach my $CookieEntry (@CookieList) { my ($k, $v) = split(/\=/, $CookieEntry); diff --git a/CGIservlet.pl b/CGIservlet.pl index a7b5c49..72ca748 100755 --- a/CGIservlet.pl +++ b/CGIservlet.pl @@ -59,6 +59,7 @@ if(grep(/\-\-help/i, @ARGV)) # # Changes (document ALL changes with date, name and email here): # +# 05 Apr 2013 - Renamed COOKIE_JAR into HTTP_COOKIE # 28 Mar 2013 - Version 1.4. # 18 Jun 2012 - Added --env, %UserEnv user defined ENV variables. Freeze %ENV. # 06 Jun 2012 - Added HTTP Cookie string to an Environment variable: COOKIE_JAR @@ -873,7 +874,7 @@ my %HTTPtype = ( 'accept-encoding' => 'HTTP_ACCEPT_ENCODING', 'accept-charset' => 'HTTP_ACCEPT_CHARSET', 'host' => 'HTTP_HOST', -'cookie' => 'COOKIE_JAR' +'cookie' => 'HTTP_COOKIE' ); ############################################################################### -- 2.11.4.GIT