title: unable to show session message in PHP?
body: <p>I set session message in my class file like <code>$_SESSION['op_status'] = 'MY MESSAGE HERE';</code> then redirect the page <code>header("location:news.php");</code> Page redirects to <code>news.php</code> but session message is not displaying.</p>
  
  <p>config.php:</p>
  
  <pre><code>&lt;?php
     session_start();
     // DATABASE CONFIURATION GOES HERE
  ?&gt;
  </code></pre>
  
  <p>news.php:</p>
  
  <pre><code>&lt;?php
    require_once 'config.php';
    require_once 'classes/class.news.php';
    $objNews = new News();
  
    if(isset($_POST['submit']) &amp;&amp; $_POST['submit'] == 'add')
     $objNews-&gt;add();
  
  ?&gt;
  
  &lt;span class='text-warning'&gt;&lt;?php echo $_session['op_status']; ?&gt;&lt;/span&gt;
  </code></pre>
  
  <p>class.news.php:</p>
  
  <pre><code>public function add() {
    if(){
       // SOME CODE GOES HERE
    } else {
       $_SESSION['op_status'] == 'Already Exist';
    }
  }
  </code></pre>