(This question is more of a reality check than anything else - I'm pretty sure this is possible, but want to be sure.)
I’m writing a proxy server that receives HTTP requests, passes them on to a remote server, and returns the remote server’s response.
I’ve run into a problem where one of the remote server responses is a 302 redirect that sets a cookie. Here’s an example:
server: nginx/0.7.65
date: Wed, 26 Jan 2011 04:42:18 GMT
connection: keep-alive
set-cookie: JSESSIONID=FFFFFFFUUUUUUUUUUU; Domain=.50.16.34.61; Path=/
location: http://50.16.34.61/client/whatever.html
content-length: "0"
When the client follows that redirect to 50.16.34.61 (a different domain than the proxy server) I notice that the cookies haven’t been set.
Am I trying to do something crazy here with the Domain part of the set-cookie directive?
Edit
Basically, I’m doing it wrong and according to http://www.ietf.org/rfc/rfc2109.txt the request-host really needs to be a superset of the Domain in the set-cookie directive.
/sad-trombone