title: Refreshing logout the user from the page
body: <p>I have a page which is refreshing every 10 sec.
  When the page refreshing kicking the user out of the page and send him to auth.php.
  With </p>
  
  <pre><code>if (!isset($_SERVER['HTTP_REFERER']))
  {
  header("location: auth.php");
  exit;
  }
  </code></pre>
  
  <p>I need this function to prevent direct access from the url.
  But the problem the user get logout after refreshing, how to make this function false when refresh is done and else  prevent direct  access from url </p>
  
  <p>My code as flow.</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;?php
  
  
  $page = $_SERVER['PHP_SELF'];
  $sec = 10;
  header("Refresh: $sec; url=$page");
  
  
  
  if (!isset($_SERVER['HTTP_REFERER']))
  {
  
  header("location: auth.php");
  exit;
  }
  ?&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>