PHP - sessions log In problem
<p>Okay when I log in as user 1 my PHP SESSIONS will stay logged in as user 1 until I leave or refresh the page and magically I'm logged in as user 2. What can be causing this problem?</p>

<p>Here is what I have at the top of all my pages.</p>

<pre><code> ob_start(); // Start output buffering.
 session_start(); // Initialize a session.
</code></pre>

<p>Here is some more code.</p>

<pre><code>ob_start(); // Start output buffering.
session_start(); // Initialize a session.
$page = 'title';
include ('../includes/header.php');

require_once ('../includes/config.inc.php'); 
require_once ('../mysqli_connect.php'); // Connect to the db.

$mysqli = mysqli_connect("localhost", "aff", "adad", "adad");

if (!isset($_SESSION['user_id'])) {

    $url = BASE_URL . 'index.php'; // Define the URL.
    ob_end_clean(); // Delete the buffer.
    header("Location: $url");
    exit(); // Quit the script. 
}
</code></pre>
