I created a table to insert a new record for each page visit. The code I have is pseudo like this: "If cookie is not set, then set the cookie and insert visitor information to the table".
The problem I have is about half of the truly unique visits to my page are inserting two identical rows into the DB. Even the same exact timestamp down to the second.
I tried echoing a debug statement inside the if statement to see if it was not setting the cookie. When I first visit the page, it shows my debug line "HIT!". Subsequent reloads and visits through the rest of the browser session do not show the debug line, so it seems to prove that it is only hitting the if statement once from the client perspective. Anyone have an idea how to resolve this?
Tags: