Firefox uses header.php twice?!
-
I use the following code in my header.php to keep track of the posts visited by users, but somehow Firefox stores two ID’s on one page visit. The second ID is from the next page published. The last post published is the only page that gets me one ID, since there is no next post.
Do you know what could be wrong?! I really appreciate all the help I can get, cause it keeps me puzzled for days now.<?php global $wp_query; $post_id = $wp_query->post->ID; $cookietime = time()+3600*24*365; $lt = '|'; if (isset($_COOKIE['tst'])) { $viewedstring = $_COOKIE['tst']; $viewedstring .= $post_id.$lt; setcookie('tst', $viewedstring, $cookietime, '/', '.domain.com'); }else{ $viewedstring = $post_id.$lt; setcookie('tst', $viewedstring, $cookietime, '/', '.domain.com'); } ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Firefox uses header.php twice?!’ is closed to new replies.