Php会话计数器变量,计数不。 来自不同浏览器的用户

how to make php counter variable which counts number of users who visited the page .
i have following code but it works in one browser fine but when i try it in other browser counter variable again starts from 1.. i want it to start from preceding value ..

session_start();
if(isset($_SESSION['counter'])){
  $_SESSION['counter']+=1;

}else{
    $_SESSION['counter']=1;
}
echo "u are visiting this page ".$_SESSION['counter']."   times";

Sessions are unique per client. If you want to count how many times a user visited the page I would recommend you to log the users IP Address. You can get the users IP Address with $_SERVER['REMOTE_ADDR']. Store this value somewhere in a database with the amount of how many times the user visited the page. Whenever someone visits your page, retrieve their IP address, run it trough your database and get the value of visits connected to that IP address. Return that value and you're done. But, if someone is on the road and uses different IP addresses or a VPN, then you counter doesn't show the real amount of unique visits.

Maybe you can also try, which I don't recommend, to store a local cookie on the users computer which contains the amount of visits.