Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about Cookies with Apache 2.0.55 (Fedora Core)

Status
Not open for further replies.

gigadude

Programmer
Feb 6, 2006
3
US
Hi,
I was wondering if anyone knew if there was a way to make Apache issue a cookie for every http request it receives. I have Cookies enabled but for some reason it only issues a cookie upon a sucessful request. I need it to generate a cookie for every request whether it was successful or not. I have Apache (v.2.0.55) running on a Solaris machine that does just this, but when trying to simple run the "out of the box" Apache server on a Linux machine it doesnt work. Any help would be greatly appreciated. Thanks.
 
You might try turning on mod_usertrack.

On my system, having the commands:


LoadModule usertrack_module modules/mod_usertrack.so

and

CookieTracking on


in httpd.conf causes Apache to generate cookies for unsuccessful requests, too.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Hi, I already did all that. Just using the "out of the box" rpm, and turning on Cookies, I can't get Apache to generate cookies for a 401. I can get Apache to generate a cookie for a 200 sucessful request, but not for anything at error level. It worked up until version 2.0.36, which is the working version I have on my solaris machine. I tried to get that version working on my Linux machine but after compliation ran into numerous segmentation faults. I just don't understand how simply running the server "out of the box" with cookies "ON" I can't get a generated cookie for anything but a successfull request.
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top