Trying to destroy uninitialized session in
<pre><code>if (!($savedid == $current_session_id)) {
    // 3. hijack then destroy session specified.
    session_id($savedid);
    session_start();
    session_destroy();
    session_commit();
    if (session_destroy()) { //eror here
        header("Location: ../../../index.php");
        exit;
    }

    // 4. restore current session id. If don't restore it,
    // your current session will refer to the session you just destroyed!
    session_id($current_session_id);
    session_start();
    session_commit();
}
</code></pre>

<p>I want to destroy a session based on its id but I get error saying <code>Trying to destroy uninitialized session in</code></p>

<p>How to destroy session using session id?</p>

<p><strong><em>UPDATE</em></strong></p>

<p>I see I just want a condition saying if session is destroyed i want to direct page to login.. how to check for that?</p>

<blockquote>
  <p>I want it like for example user log in in pc1 then log in in pc2 pc1 will be directed to login</p>
</blockquote>