title: PHP semaphore (in same browser)
body: <p>If I want prevent multiple execution of a code <strong>in same browser</strong>, why PHP semaphore not working in same browser or another browser tab?</p>
  <p><a href="https://www.php.net/manual/en/intro.sem.php" rel="nofollow noreferrer">https://www.php.net/manual/en/intro.sem.php</a></p>
  <p>This code work <strong>only in different browsers</strong>, why not working in same browser, when i execute script simultaneously in same browser (php7.4-fpm + nginx)</p>
  <pre><code>$semaphore_key = 25;
  $semaphore_max = 1;
  $semaphore_permissions = 0666;
  $semaphore_autorelease = 1;
  $semaphore = sem_get($semaphore_key, $semaphore_max, $semaphore_permissions, $semaphore_autorelease);
  
  if(sem_acquire($semaphore, true) === false) { 
      echo &quot;error&quot;;
      exit();
  }else{
      echo &quot;ok\n&quot;;
  }
  
  sleep(30);
  sem_release($semaphore);
  </code></pre>