title: php alert does not work when redirect to another page with session variable
body: <p>I need to prevent access to "<a href="http://localhost/oms/category/index.php" rel="nofollow noreferrer">http://localhost/oms/category/index.php</a>" page where $_SESSION['role'] is not equal 'Administrator' or 'Operator'. so when an user with another role (not admin or operator) try to access to above page, user is redirected to another page. it's ok. but alert message is not work. how can i fix this. </p>
  
  <p>code in localhost/oms/category/index.php is here</p>
  
  <pre><code>session_start();
  if (!isset($_SESSION['username'])) {
  header('Location: ../login/index.php');
  }
  if (!($_SESSION['role'] == 'Administrator' || $_SESSION['role'] == 
  'Operator')) {
  $_SESSION['alert-warning'] = "You do not have permission to access the 
  page.";
  header('Location: ../customer-order/');
  }
  </code></pre>
  
  <p>code in redirected page is here</p>
  
  <pre><code>&lt;?php
  session_start();
  if (isset($_SESSION['alert-success'])) {
  ?&gt;
  &lt;div class="alert alert-success" id="success-alert" role="alert" data-auto- 
  dismiss="2000"&gt;
      &lt;button type="button" class="close" data-dismiss="alert"&gt;x&lt;/button&gt;
      &lt;strong&gt;Success! &lt;/strong&gt;
      &lt;?php echo $_SESSION['alert-success']; ?&gt;
  &lt;/div&gt;
  &lt;?php
  unset($_SESSION["alert-success"]);
  } else if (isset($_SESSION['alert-unsuccess'])) {
  ?&gt;    
  &lt;div class="alert alert-danger" id="unsuccess-alert"&gt;
      &lt;button type="button" class="close" data-dismiss="alert"&gt;x&lt;/button&gt;
      &lt;strong&gt;Error&amp;nbsp;!&amp;nbsp;&amp;nbsp; &lt;/strong&gt;
      &lt;?php echo $_SESSION['alert-unsuccess']; ?&gt;
  &lt;/div&gt;
  &lt;?php
  unset($_SESSION["alert-unsuccess"]);
  } else if (isset($_SESSION['alert-warning'])) {
  ?&gt;
  &lt;div class="alert alert-warning" id="success-alert" role="alert" data-auto- 
  dismiss="2000"&gt;
      &lt;button type="button" class="close" data-dismiss="alert"&gt;x&lt;/button&gt;
      &lt;strong&gt;Warning! &lt;/strong&gt;
      &lt;?php echo $_SESSION['alert-warning']; ?&gt;
  &lt;/div&gt;
  &lt;?php
  unset($_SESSION["alert-warning"]);
  }
  ?&gt;
  </code></pre>