InfiniteSilence has asked for the wisdom of the Perl Monks concerning the following question:
Note the "==1"s. Also, the quickest glance through the CGI::Cookie perldoc shows that you can use values for -expires like '3M':sub SetCookies { my (%input) = @_; while( my($name,$value) = each %input ) { my $c = CGI->cookie ( -name => $name, -value => $value, -expires => ((exists($cookie_config{expir +es}) && $cookie_config{expires} ==1) ? $cookie_config{expires} : unde +f), -domain => ((exists($cookie_config{domai +n}) && $cookie_config{domain} ==1) ? $cookie_config{domain} : unde +f), -secure => ((exists($cookie_config{secur +e}) && $cookie_config{secure} ==1) ? $cookie_config{secure} : unde +f), -path => ((exists($cookie_config{path} +) && $cookie_config{path} ==1) ? $cookie_config{path} : unde +f), ); print "Set-Cookie: ", $c, "\n"; } }
So, is the above supposed to be a secure version usage of the CGI::Cookie module? If so, why?$c = new CGI::Cookie(-name => 'foo', -value => 'bar', -expires => '+3M', -domain => '.capricorn.com', -path => '/cgi-bin/database', -secure => 1 );
Update #2: As a result of my posting the following was appended to the modification history of CookieLib at NMS:
And the code has, apparently, been modified. Thank you gellyfish for your prompt action.# $Log: cookielib,v $ # Revision 1.6 2006/04/08 08:34:31 gellyfish # Appeared to be a cut and paste error in SetCookies
Celebrate Intellectual Diversity
Moved from Perl Monks Discussion to Seekers of Perl Wisdom by planetscape
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: NMS, London PM?
by PodMaster (Abbot) on Apr 08, 2006 at 01:06 UTC | |
|
Re: NMS, London PM?
by gellyfish (Monsignor) on Apr 10, 2006 at 20:52 UTC |