What you are trying to do is not possible with only PHP and it would never be waterproof, what if your user is at the home page and refreshes the page x
times... ?
What you need to do instead is to wrap your code with a check whether the counter already has been incremented for the specific session. As you did not give your code specifics, here is some pseudo code.
<?php
session_start();
if (!isset($_SESSION['counter_incremented'])) {
/**
Your current increment code
**/
$_SESSION['counter_incremented'] = true;
}
do note that the counter will be incremented once per session, meaning if an user closes his browser and returns to the home page, the counter will be incremented again by one