yperl wrote:
> Finally I come with a working solution.
> 
> sub getCookie {
> 
>  my ( $r ) = @_;
> 
>  # check for both 'Cookie' and 'Set-Cookie' HTTP headers
>  return $r->headers_in->{'Cookie'} || $r->headers_in->{'Set-Cookie'};
> }

but that's just wrong :)

Set-Cookie is a response header, so it will be set in $r->headers_out when
the server decides to send a cookie to the client.  Cookie is a request
header, so you glean it from $r->headers_in if the client has one to give
you.  you'll never see Set-Cookie in $r->headers_in unless someone has made
a grave mistake.

you can see the gory details in the rfc

  http://www.ietf.org/rfc/rfc2109.txt

HTH

--Geoff

Reply via email to