Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my $secure_cookie = 1;
- $secure_cookie = 0 if (not defined $ENV{HTTP_HOST} or $ENV{HTTP_HOST} =~ m/localhost/);
- if ($ENV{HTTPS} eq 'on' or $ENV{HTTP_X_REQUEST_PROTOCOL} eq 'https' or not defined $ENV{HTTP_HOST} or $ENV{HTTP_HOST} =~ m/localhost/) {
- CGI::Cookie->new(-name=>'SESSION_ID', -value=>$session->{_session_id}, -secure=>$secure_cookie)->bake;
- # But, if they aren't on HTTPS, keep them logged out.
- } else {
- CGI::Cookie->new(-name=>'SESSION_ID', -value=>0, -secure=>$secure_cookie)->bake;
- }
- $session->{__counter__} = $session->{__counter__}+1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement