Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP Session Data Not Being Stored
    primarykey
    data
    text
    <p>I'm making a login system, but when a user logs in, it doesn't actually store any of the data i want it to in the session. I even checked the session's file, and it was empty. I have session_start(); on all the pages. what else could i be doing wrong. Heres the code for the two main pages.</p> <p>the login code:</p> <pre><code>&lt;? if ($DEBUG == true) { error_reporting(E_ALL); } require "header.php"; require_once "dbinterface.php"; require_once "user.class.php"; require_once "config.inc.php"; $db = new db($DB['host'], $DB['user'], $DB['pass'], $DB['database']); $u_result = $db-&gt;run("select user_id from users where user_name = '" . $db-&gt;escape($_POST['user_name']) . "'"); if ($u_result == false) { $url = 'Location: error.php?id=8'; header($url); } if (count($u_result) &lt; 1) { $url = 'Location: error.php?id=3'; header($url); } $user = new user($u_result[0]['user_id']); if ($user-&gt;match_password($_POST['pass']) == true) { $_SESSION['authenticated'] = true; $_SESSION['user_id'] = $u_result[0]['user_id']; $_SESSION['user'] = $user; } else { $url = 'Location: error.php?id=4'; header($url); } session_write_close(); header('Location: index.php'); ?&gt; </code></pre> <p>The header that gets included in every page:</p> <pre><code>&lt;?php if (!session_start()) { $url = "Location: error.php?id=13"; header($url); } ?&gt; </code></pre> <p>A little background:</p> <ul> <li>windows 7 (also tried on windows</li> <li>server 2008, but currently on 7) PHP</li> <li>5 localy hosted problem is present</li> <li>for everyone problem exists in all</li> <li>browsers</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload