Skip to content

Commit

Permalink
resolve #220 - pass max_age and samesite to CGI::Cookie
Browse files Browse the repository at this point in the history
in the CGI::cookie method
  • Loading branch information
leejo committed Apr 6, 2017
1 parent 96ce794 commit 1d712e9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/CGI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2755,8 +2755,8 @@ sub url {
####
sub cookie {
my($self,@p) = self_or_default(@_);
my($name,$value,$path,$domain,$secure,$expires,$httponly) =
rearrange([NAME,[VALUE,VALUES],PATH,DOMAIN,SECURE,EXPIRES,HTTPONLY],@p);
my($name,$value,$path,$domain,$secure,$expires,$httponly,$max_age,$samesite) =
rearrange([NAME,[VALUE,VALUES],PATH,DOMAIN,SECURE,EXPIRES,HTTPONLY,'MAX-AGE',SAMESITE],@p);

require CGI::Cookie;

Expand Down Expand Up @@ -2784,6 +2784,8 @@ sub cookie {
push(@param,'-expires'=>$expires) if $expires;
push(@param,'-secure'=>$secure) if $secure;
push(@param,'-httponly'=>$httponly) if $httponly;
push(@param,'-max_age'=>$max_age) if $max_age;
push(@param,'-samesite'=>$samesite) if $samesite;

return CGI::Cookie->new(@param);
}
Expand Down

0 comments on commit 1d712e9

Please sign in to comment.