0

Apache running on (dummy IP)

 http://1.1.1.1:2222

IIS 7.5 running on

 http://1.1.1.1:80

Apache Config (proxying to IIS port 80)

ProxyPass /a http://1.1.1.1:80/a
ProxyPassReverse /a http://1.1.1.1:80/a

When I hit apache's URL

http://1.1.1.1:2222/a ,

which return a setCookie (from IIS port 80)

Set-Cookie:ASP.NET_SessionId=4wlnzzzzljdqnyyro55; path=/; HttpOnly

From chrome's web-inspector, The cookie is both set on port 2222 (apache) and port 80 (IIS).

Does it mean Apache proxies the cookie to IIS on port 80 and hence the cookie set on both port 80 and 2222 ?

or have I missed something?

Petr Šrámek
  • 435
  • 7
  • 26
Lydon Ch
  • 8,637
  • 20
  • 79
  • 132
  • Your cookie is per-host and per-path, not per-port. This means your browser will send the cookie to its calls to 1.1.1.1 regardless of the port number. You could set the cookie for `/a` instead of `/`, which means it will technically only reach IIS. Is this an academic question? Also, possible duplicate of [Are HTTP cookies port specific?](http://stackoverflow.com/questions/1612177/are-http-cookies-port-specific). – bzlm Aug 01 '12 at 08:42
  • any way to force apache to forward the cookie to IIS ? – Lydon Ch Aug 01 '12 at 08:53
  • That's happening already. As you say, "the cookie is both set on port 2222 (apache) and port 80 (IIS)". `mod_proxy` takes care of forwarding the cookie to IIS. The fact that the cookie is "set on port 80" is a bit misleading, and is only how Chrome perceives it, so you should ignore that bit. The only thing that matters is what Chrome sends to Apache, which includes the Cookie you've previously set. – bzlm Aug 01 '12 at 09:04

0 Answers0