Forum Moderators: coopster

Message Too Old, No Replies

Inconsistant Cookie Behavior

Sometimes it writes ..sometimes not

         

cabbagehead

10:05 am on Nov 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm new to PHP (from other languages) and I wrote a cookie based tracking tool in PHP. The problem is that the cookie behavior is EXTREMELY inconsistant.

The idea is that the cookie should write the referrer information on whatever page the user lands on. The include for writing the cookie is included on every page of the site and has a conditional wrapper that essentially says don't write the cookie if the cookie exists. Thus should preserve the value of the first page the user lands on so that I can retrieve the information later. Unfortunately, sometimes the page written is not the first page of landing .. but rather the last page prior to the page that requests the cookie.

Its so wierd. And then other times, the cookie is just empty. I can't help but wonder if there is some default caching setting on Apache that is throwing me off (?).

Anyone know anything about this? I haven't had this problem in ASP or in JSP. :-\

Thanks.

cabbagehead

10:28 am on Nov 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually, this *does* appear to be a caching issue. Geeze! If I print a timestamp to every page, it works fine.

So next question - how do I get rid of this unexpected caching feature? Or better yet, it there any way to have it continue to cache the output but not the page header?

Thanks.