title: Why is my session unset/ destroy not working?
body: <p>On my page I have a session being created which can be accessed and called fine usually. However, I am adding a logout button which links to <code>logout.php</code> which only contains the lines</p>
  <pre><code>session_unset();
  session_destroy();
  </code></pre>
  <p>Noting out the <code>session_destroy</code>, I've noticed that there is no error, but nothing happens to the current session. However, <code>session_destroy</code> is giving the following error. Similar questions show that this is because people have not called session start, but the session has been started in my <code>login.php</code></p>
  <p><a href="https://i.stack.imgur.com/SKI7p.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SKI7p.png" alt="error" /></a></p>