Everything works as expected with the exception of the httponly flag which is not being set. I have used Firefox and Chrome to view the headers but neither show as having the httponly flag set.

How are you checking to see if the flag is set?

Tools + Options + Privacy + Show Cookies?

Yeah, I can confirm that widget doesn't indicate whether or not httponly is set, but the header is sent

$ 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 07:54:06 GMT; secur +e; HttpOnly

$ lwp-request -USEd http://localhost/cgi-bin/httponly.cgi GET http://localhost/cgi-bin/httponly.cgi User-Agent: lwp-request/6.03 libwww-perl/6.03 200 OK Connection: close Date: Fri, 10 Feb 2012 07:59:39 GMT Server: Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.7g PHP/4.3.11 + mod_perl/2.0.1 Perl/v5.8.9 Content-Type: text/html; charset=UTF-8 Client-Date: Fri, 10 Feb 2012 07:59:42 GMT Client-Peer: 127.0.0.1:80 Client-Response-Num: 1 Client-Transfer-Encoding: chunked Set-Cookie: mycookie=foo&bar; path=/; expires=Thu, 10-May-2012 07:59:4 +1 GMT; secure; HttpOnly Title: Untitled Document

From the Web Console ( Ctrl+Shift+K ) I can confirm that cookies set with httponly don't show up in document.cookie

So yeah, it works


In reply to Re: Cannot get httponly to work by Anonymous Monk
in thread Cannot get httponly to work by SquirrelHead

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.