The core of the problem is that you set cookies when the content is being accessed, not when it is read. Browsers can try to prefetch content, and your description sound like the browser is prefecthing the “next” link found in the header.
From experience, you should avoid setting cookies on the server and prefer setting them on client side (add to the html a small JS that will set the cookie) or even better if possible, use local storage instead.
Related Posts:
- Passing current cookies in wp_remote_get to get Draft Post Preview
- How to mark articles as read?
- Querying post from a multisite network
- How to hide a post from ‘Recent Posts’ widget?
- How to get most recent commented post above new submitted post in WordPress?
- How to start with post number x?
- Display most recent post on homepage?
- Duplicate posts and change category
- recent posts for different categories
- WP Bakery Load More Button loads the same posts
- Multi row post list
- How to get date of post when using wp_get_recent_posts()?
- Latest posts by category — how to exclude current post?
- Add hero image to home page (blog format) via the dashboard
- Why aren’t paragraphs breaking on this page?
- Get x recent posts by author?
- Showing recent post of category in page
- How to show 3 most recent/viewed posts in a special tiles on home page using wordpress?
- Prevent duplicate pages from being added
- Google indexing duplicate page content with Page #### in post title and /page-2 in permalink instead of the ones I set
- SQL query: select duplicate posts – but using duplicate meta [duplicate]
- Have latest post and recent posts display differently
- removing inline styles from wp-caption div
- Different post sort order within different categories
- How to export posts with featured image
- How are terms connected with posts in database?
- blog posts sorting doesnt work while using get_query_var
- JSON not valid after json_encode posts
- Post Admin – Filter by posts without tags
- Post & edit a post from front end along with upload, dropdown, and other inputs
- Text after more tag in posts
- Hide parts of the post content on the home page
- Create A Metabox For A Custom Field
- Get the post_id of a new post
- Prevent post from being published if no category selected
- Load content in a div with ajax
- Get a custom field of all posts on current blog page
- Display posts in alphabetical order for a particular category
- When trashing a post, also trash related comments
- Loop through all product posts?
- Image Insert into posts and pages not working after 3.2.1 update
- How to add Tags Filter in wordpress admin dashboard
- How to display featured image without it appearing in post?
- allow new users to post an article before they sign up [closed]
- Make Post Editor Select Number of Columns To 1 By Default
- Adding the_date inside tags around the_content
- Mixing Tweets with Posts
- Problem with permalink routing?
- Ajax post filters not working
- Making a custom Pagination for multi page blog post
- Listing Specific Categories from Current Post with Depth
- Custom Post Type Rewrite To Include Parent Page(s)
- Getting only the URL of the post thumbnail
- outputting posts’ taxonomies: cant get ‘get_the_taxonomies’ working
- Displaying posts that belong to a specific author
- Query for first 3 posts to change the look and feel
- Getting blog pagination to work on page set as front page
- How to identify and hide/remove an element from a WordPress page [closed]
- Navigate through the posts using keyboard arrows
- unique post in “$args” of wp_query display more than one post
- New Posts and Pages Won’t Save
- Why excerpt is Displaying same in Random Posts list
- Is there a way getting post fields using `transition_post_status`
- Show posts on front page only
- Get featured image on hover of post title [closed]
- How get top post view for today for today post
- Changing wp_link_pages() to “Next Page” and “Previous Page” buttons?
- Why my meta boxes won’t show in front post page?
- Authors’ Links on Homepage Not Going to Author Post Pages
- My post does not show up
- Display Current Posts Category (with the most posts)?
- How can I add random alphabets in wordpress permalink posts structure
- AWS usage queries
- Filter posts by month (dropdown)
- Redirect old Posts URL to new URL
- Create a tree with categories with get_posts()
- Use posts from old db by changing prefix
- Center crop the feature image
- Display Custom Post Category Count & WordPress Category Count Using Shortcode
- Override default post type ‘post’
- ‘posts’ table should not store the absolute image path
- Display post on main page with thumbnail
- Redirecting user to a page when there is no content?
- How can I alternate styling of images in a post? [closed]
- Custom Single Post Type not referring to single-post-type.php File
- Display iframe or embeded posts on homepage
- index.php is only displaying current month’s posts?
- How can I use the “Your latest posts” as a template?
- Query to get data of a post, if in category?
- Order posts by custom field
- “Current” class on a singular page menu item with custom post types?
- Continuous listing from a custom field
- Add class name of content, Hypernate doesn’t work to IE and Chrome
- 2 tick boxes appearing below comments
- Issue with wordpress pagination: last 2 posts show again on second page
- Extra Theme – Fit image inside of Featured Post Slider
- Polylang – display one post into 3 categories with different lang [closed]
- How can I show the positive and negative comments for a same post separately?
- Site ‘Categories’: save an admin global setting with post metadata [closed]
- I cannot see the pagination in /wp-admin posts page