title: Is there any alternative way to session based user access control?
body: <p>For my project I'm  using session based access control to handle different type of users, 
  is it secure? is there any other way to do same thing?
  This is my coding. </p>
  
  <pre><code>// Note : $_SESSION['role']==1 refer to Admin and ['role']==3 refer to staff 
  
  session_start();
  if(!empty($_SESSION['cur_user'])&amp;&amp;($_SESSION['role']==1) || ($_SESSION['role']==3)  )
  {
     //if user login details is correct .. doing some stuff         
  ?&gt;
  
  &lt;!-- Website Content--&gt;
  
  &lt;?php
  }
  
  else{
      unset($_SESSION['cur_user']);
      session_destroy();
      header ("location:login.php");
  }
  
  ?&gt;
  </code></pre>