Hi, I have an extremely simple script which reads a cookie and then prints it.
The script works fine when called from the script path ex:
http://...cgi-bin/test.cgi
But it won't print when called from an SSI.
ex: <!--#INCLUDE virtual="/cgi-bin/test.cgi"-->
Can anyone shed some light on why this doensn't work?
Mucha appreciated,
Kevin
THE SCRIPT (test.cgi)
--------------------------------------------------------
use CGI::Cookie;
### Use this to set the cookie ##############
#%shopcart = (
# this => "that",
# color=> "red"
#);
#$cookie1 = new
CGI::Cookie(-name=>'shopcart',-value=>\%shopcart,-expires=>'+1h');
#print "Set-Cookie: $cookie1\n";
####################################
# fetch existing cookies
%cookies = fetch CGI::Cookie;
%shopcart = $cookies{'shopcart'}->value if ($cookies{'shopcart'});
print "Content-type: text/html\n\n";
print %shopcart;
The script works fine when called from the script path ex:
http://...cgi-bin/test.cgi
But it won't print when called from an SSI.
ex: <!--#INCLUDE virtual="/cgi-bin/test.cgi"-->
Can anyone shed some light on why this doensn't work?
Mucha appreciated,
Kevin
THE SCRIPT (test.cgi)
--------------------------------------------------------
use CGI::Cookie;
### Use this to set the cookie ##############
#%shopcart = (
# this => "that",
# color=> "red"
#);
#$cookie1 = new
CGI::Cookie(-name=>'shopcart',-value=>\%shopcart,-expires=>'+1h');
#print "Set-Cookie: $cookie1\n";
####################################
# fetch existing cookies
%cookies = fetch CGI::Cookie;
%shopcart = $cookies{'shopcart'}->value if ($cookies{'shopcart'});
print "Content-type: text/html\n\n";
print %shopcart;