Re: Apache2 module_usertrack (Usertrack Module) + PHP4 $_COOKIE empty



If $_COOKIE is empty, check apache_response_headers(). The "Apache"
cookie is in the response headers to the client on the first request,
which makes perfect sense now that I think about it.

Array (
[Set-Cookie] => Apache=192.168.0.137.1129833346419328; path=/;
expires=Sat, 13-Oct-35 18:35:46 GMT
[X-Powered-By] => PHP/4.4.0-2 );


Erik Osterman





Erik Osterman wrote:
> Greetings,
>
> I have problems using the Apache2 module_usertrack in combination with
> PHP. PHP only sees the "Apache" cookie (default name) in
> $_COOKIE[Apache] after the page has been refreshed once (on the first
> request, $_COOKIE is empty. 2nd request all OK).
>
> Now, I understand that the user hasn't yet sent any cookie headers, so
> from a technical perspective they shouldn't be in $_COOKIE. My
> understanding, however, of the usertrack module is that it fibs this a
> little bit and sets the cookie (retro-actively) as though it had been
> sent on the first request (for point-to-point tacking). Further more,
> you can record the cookie on the FIRST request to the server in the
> Apache2 logs.
>
> At first, I was hopeful it had to do with the order that the modules
> are loaded. I placed the usertrack module explicitly above the php4
> modules. Unfortunately, no luck.
>
> Does any body have any ideas as to how to get PHP+usertrack to
> cooperate? Or is it an Apache impossibility?
>
> BTW, not interested in alternate solutions (e.g. start_session, or
> generating my own uids and calling SetCookie). This question is
> specifically on how to solve this problem.
>
>
> Best Regards,
>
>
> Erik Osterman

.



Relevant Pages