注销后PHP会话不会重新创建

Login Function:

// Create User Session Variable
session_start();
$_SESSION['session_id'] = $session_id;

Logout Function:

// Clear Session Variable
session_start();
unset ($_SESSION["session_id"]);

Test PHP File

// Start Session
session_start();
echo "Output Session Variables <br>";
echo "Session ID: " . $_SESSION['session_id'] . "<br>";

When a user first opens the browser (tried on Edge and Chrome) and logs in the test file displays a session. Then when the user logs out it displays the session is null. But if the user logs right back in the test file says the session is null. Yet the entire webapp treats the user as logged in and allows the user to see areas that are set to display only if session_id is not empty. Logging out again and back in does not fix the problem, only closing the browser does.

The final weird thing that happens is if you log in, log out and then log in and attempt to do something on the webapp that modifies the database it redirects to the login page where on successful login the test php file once again shows a session.

Clarification

This is the timeline of what happens:

  1. Open Browser
  2. Go to website
  3. Login - $_SESSION['session_id'] = uniqid() . "_" . $user_id;
  4. Open another tab and run test.php. Session ID: Random Number_UserID
  5. Logout - unset ($_SESSION['session_id']); $_SESSION = array(); session_destroy(); // I tried everything
  6. Log right back in and run test.php Session ID is null

Yet the webapp operates like if session_id is not null. I can Insert its value into the database.