param_name => 'cah_associd',
cookie_name => 'cah_associd', # make undef to disable cookie
cgi => undef,
- param_get => sub { $s->_c()->param($s->{S}{param_name}) },
- cookie_get => sub { $s->_c()->cookie($s->{S}{cookie_name}) : '' },
+ get_param => sub { $s->_c()->param($s->{S}{param_name}) },
+ get_cookie => sub { $s->{S}{cookie_name}
+ ? $s->_c()->cookie($s->{S}{cookie_name})
+ : '' },
+ get_method => sub { $s->_c()->request_method() },
},
D => undef,
};
}
sub check () {
- my $passocid = $s->{S}{param_get}();
- my $cassocid = $s->{S}{cookie_get}();
- if (
+ my $qassocid = $s->{S}{param_get}();
+ if (!defined $qassocid) {
+ $qassocid = $s->{S}{cookie_get}();
+ return 0 unless defined $qassocid;
+ return 0 unless $s->{S}{get_method}() eq 'GET';
+ }
+