I am saving the post->ID in a session array to keep a history of the accessed pages for a specific custom post type. This code was added to that specific custom post type's template, so that the session data only updates for requests for this type.
So, if the user loads the page with postID 1, then "1" is saved in the session. If he then loads a page with postID 5, then "5" is added to the session, resulting in array(1, 5), and so on.
This works just fine across all major browsers with the exception of FireFox (Windows & Mac). For some reason the initial session is saved properly, but the next time I reload the same page, it will suddenly show for example array(1, 5) even though only postID 1 was accessed.
I added logging to the script to log whenever the session data gets updated and that's when I noticed that for some reason FireFox sends like a partial request (faster than full page load) before loading the actual post, e.g.:
- user loads page with postID 1, session gets updated with array(1)
- user hits reload, FireFox loads postID 5 and then loads postID 1 again, resulting in array(1, 5)
This extra page load is not visible and also doesn't show in Firebug, but somehow FireFox sends those multiple page requests even when just reloading a single page.
I have already ruled out the code, since it's working fine in all other browsers and I also disabled all plugins/addons but it still happens even in vanilla FireFox. Plus it's cross-platform, so happens on a mac & windows PC when using FireFox.
Has anyone experienced a similar issue before?