According to the Apache specs, once Cookies are turned on, they are sent for every request, whether that request is successful or not. Let me post some output here to show you the problem I am having.
Running CURL to send a request to an Apache 2.0.36 server running on a Solaris machine produces the following output.
(notice the cookie is in the header whether or not it's successful)...
ERROR RESPONSE CONTAINS COOKIE-----------------------
curl -I
HTTP/1.1 401 Authorization Required
Date: Tue, 07 Feb 2006 14:14:07 GMT
Server: Apache/2.0.36 (Unix) DAV/2 mod_ssl/2.0.36 OpenSSL/0.9.6d PHP/4.2.1
Basic realm="eTactics Inc"
Vary: accept-language
Set-Cookie: eTacticsInc=172.16.110.201.1139321647413540; path=/; max-age=3600
Accept-Ranges: bytes
Content-Length: 1058
Content-Type: text/html; charset=ISO-8859-1
SUCCESSFUL RESPONSE CONTAINS COOKIE-----------------------
curl -I
HTTP/1.1 200 OK
Date: Tue, 07 Feb 2006 14:19:52 GMT
Server: Apache/2.0.36 (Unix) DAV/2 mod_ssl/2.0.36 OpenSSL/0.9.6d PHP/4.2.1
Set-Cookie: eTacticsInc=172.16.110.201.1139321992281629; path=/; max-age=3600
Last-Modified: Wed, 13 Jul 2005 20:50:16 GMT
ETag: "510f7-3359-29f6b200"
Accept-Ranges: bytes
Content-Length: 13145
Content-Type: text/html; charset=ISO-8859-1
Running CURL to send a request to an Apache 2.0.55 server running on a Linux Fedora Core 4 machine produces the following output.
(notice the cookie is in the header if its successful but not if its an error)...
ERROR RESPONSE DOES NOT CONTAINS COOKIE-----------------------
curl -I
HTTP/1.1 404 Not Found
Date: Tue, 07 Feb 2006 14:22:00 GMT
Server: Apache/2.0.54 (Fedora)
Connection: close
Content-Type: text/html; charset=iso-8859-1
SUCCESSFUL RESPONSE CONTAINS COOKIE-----------------------
curl -I
HTTP/1.1 200 OK
Date: Tue, 07 Feb 2006 14:19:44 GMT
Server: Apache/2.0.54 (Fedora)
Set-Cookie: eTacticsInc=172.16.110.201.1139321984602103; path=/; max-age=3600
Accept-Ranges: bytes
Content-Length: 3931
Connection: close
Content-Type: text/html; charset=UTF-8
The strange thing about this anomalie is that it occurs no matter which version of Apache I install. As long as it's Apache, and it's running on Linux Fedora Core 4, it doesn't matter if its installed via RPM or from source, whether or not its "fresh out of the box" or customized, the bottom line is...
IT DOESN'T WORK! I sure hope someone out there has some clue on what is going on here. I am in a bind, because I need to migrate my server, and I will not migrate it to another Solaris machine. Thanks.