in reply to Re: Cannot get httponly to work
in thread Cannot get httponly to work

Hi there

Thanks for taking the time to reply to this, it's much appreciated.

I have run the command you entered from the command line but I get a different result to what you are seeing on screen

$ perl -MCGI::Cookie -le " print CGI::Cookie->new( qw/ -name mycookie +/, -value => [qw/ foo bar /], qw/ -secure 1 -httponly 1 -expires +3M +/ ) " mycookie=foo&bar; path=/; expires=Thu, 10-May-2012 08:38:56 GMT; secur +e

As there is no mention of the httponly flag being set do you think this is an issue with our Apache install or version rather than Perl?

Up until now I have been viewing the cookie information through the Live Headers add-in in Firefox and by using the Tools, Developer Tools, Resources, Cookies menu options in Chrome.

Thanks again for the help here.

Cheers

SquirrelHead

Replies are listed 'Best First'.
Re^3: Cannot get httponly to work
by Anonymous Monk on Feb 10, 2012 at 09:07 UTC

    Upgrade CGI

    $ pmvers CGI CGI::Cookie CGI: 3.59 CGI::Cookie: 1.30 $ perl -MCGI -le " print CGI->cookie( qw/ -name mycookie /, -value => +[qw/ foo bar /], qw/ -secure 1 -httponly 1 -expires +3M / ) " mycookie=foo&bar; path=/; expires=Thu, 10-May-2012 09:12:33 GMT; secur +e; HttpOnly $ $ perl -MCGI -d:Modlist -le " print CGI->cookie( qw/ -name mycookie /, + -value => [qw/ foo bar /], qw/ -secure 1 -httponly 1 -expires +3M / +) " mycookie=foo&bar; path=/; expires=Thu, 10-May-2012 09:12:39 GMT; secur +e; HttpOnly CGI 3.59 CGI::Cookie 1.30 CGI::Util 3.53 Carp 1.23 Exporter 5.66 constant 1.21 overload 1.13 vars 1.02 warnings 1.12 warnings::register 1.02

      Hi again

      I have 3.15 and 1.26. Time for an upgrade I think.

      I'll post results after update.

      Thanks

      SquirrelHead

        Hi again,

        I've upgraded CGI and CGI::Cookie to versions 3.59 and 1.3 and running the same code now correctly sets the httponly flag.

        Thank you, you are a lifesaver.

        Cheers

        SquirrelHead