1

I have been researching for 2 days now as to why my script isn't working. All I wanted to do is create a simple sign up, login, logout script. I have the signup working just fine. When I go to login, the $_SESSION doesn't want to work and I have no idea why. Here's a bit of my code:

$userArr = mysql_fetch_array($query);
$stored_pwd = $userArr['password'];
$id = $userArr['id'];

if (md5($password) == $stored_pwd) {
    $_SESSION['uid'] = $id;
    $_SESSION['start'] = time();
    session_regenerate_id();
    header("Location: ".$redirect);
} else {
    $errors[] = "The passwords don't match. Please try again.";
}

So I have no idea what's wrong. I called the session_start() on all pages along with ob_start() and ob_flush(). Any help is appreciated.

4

0 に答える 0