Hi I’m looking for a function/module to check if visitors have their cookies enabled when they come to my site. I think that there might all-ready might be a module for this, but I haven’t been able to locate it. I have so for been trying work around the problem myself with something like this.( se below) It gives the right answer if cookies is allowed, but if not the script just stop when I call the fetch CGI::Cookie My error log says:” Can't call method "value" on an undefined value at /usr/local/apache/cgi-bin/cook6.pl line 25” ( it is referring to :” $id = $cookies{'oversaet'}->value;”) Any help with telling me which module to use, or how to work around this problem with my script will be greatly appreciated.
#! /bin/perl -w use CGI::Cookie; use CGI qw/:standard/; my $query = new CGI; $jack = "flow"; $c = new CGI::Cookie(-name =>'oversaet', -value => ['11111',$jack], -path => '/', -expires => "+25m"); print header (-cookie=>$c); print $query->start_html(-tittle=>'example'); print "<html><head><title>cookies</title></head>\n"; %cookies = fetch CGI::Cookie; $id = $cookies{'oversaet'}->value; if ($id = "11111$jack") { print "cookie set"; } else { print "cookie NOT set!!!";