in reply to Passing cookies through a PERL HTTP Proxy

Essentially I'm "catching" the request via standard CGI, .... but the one place I'm having trouble that I can't figure out is how to pass cookies through this layer.

A cookie is just another header, but since it has fields like "domain", you may have to translate it -- the HTTP Proxy RFC should have the required details

Are you running your "cgi" as nph? I think you need nph to make this work if its possible

  • Comment on Re: Passing cookies through a PERL HTTP Proxy

Replies are listed 'Best First'.
Re^2: Passing cookies through a PERL HTTP Proxy
by cls33 (Novice) on Apr 17, 2013 at 13:55 UTC
    I'm still missing something. I can pull the cookie out of the response header easily enough:
    my $CookieHeader = $response->header('Set-Cookie');

    But I'm not sure how to pass that back to the browser. Right now I send the response back like so:

    if ($response->is_redirect) { print $cgi->redirect(-uri=>$response->header('Location'), -status=>$response->code ); } else { print $cgi->header($ResponseContentType); print $response->content; }


    I guess I'm not sure how to use CGI to invoke Set-Cookie. I know it has a -cookie option, but I don't have a CGI cookie object, so I don't think that will work...redirect(-uri=