I am having a weird problem that occurs when changing the default permalinks in WordPress.
When I put this code in my functions.php file in my theme (or even in the root index.php file in WordPress) and move between them and refresh several pages (for example, the / about page), my counter often runs twice.
This issue is reproducible on every server I tried, and on any WordPress theme or installation. Another thing that confuses my brain even more is that it is not found in Safari, Internet Explorer (6, 7, and 8), but only in Firefox . I am using Firefox 3.6.8 and have tried it on both Mac OS X and Windows XP.
session_start();
$counter = $_SESSION['wp_action_counter'];
if( !isset($counter) ){
$counter = 0;
}
$counter++;
echo $counter;
$_SESSION['wp_action_counter'] = $counter;
.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
, , .