0

In my project, there is just one file index.php and the following is the entire content of it:

<?php
session_start();

if(isset($_SESSION['count'])) {
    $_SESSION['count'] = intval($_SESSION['count']) + 1;
}
else {
    $_SESSION['count'] = 0;
}

echo $_SESSION['count'];    

For some reason, the script runs twice and thus increments by 2 on each reload. I do not have any .htaccess file or any rewrite rules that I know of. I am running laravel valet as a webserver.

Additionally, I have observed that the problem persists when opening the script in chrome, but not in firefox.

Where could I look in order to start debugging this issue?

Jacobdo
  • 1,681
  • 2
  • 18
  • 38
  • 1
    Maybe your browser is sending multiple requests? You can try using a different browser or a tool like Postman or CURL to send the requests. On Chrome you can try to disable the "Predict network actions to improve page load performance" under the settings. – Ivar May 26 '19 at 14:43
  • Could not find that settings in chrome settings. – Jacobdo May 26 '19 at 17:44

0 Answers0