I figured it out. Somewhere between 4.2.1 and 4.2.3 the operation of ob_start() changed. It no long buffers the header() function, but it does buffer the cookie function. Since cookies have to be the first headers, the setcookie() function was never even getting called. it was getting buffered.
I got around it like this....
<?php
ob_start();
include("includes/connection.php");
if($submitlogin == "true" && $username !="" && $password != "")
{
$query = "SELECT * FROM users WHERE username = '" . $username ."';";
$recordset = mysql_query($query, $connection);
$row = mysql_fetch_array($recordset, MYSQL_ASSOC);
if (($row['username'] == $username) && ($row['password'] == base64_encode($password)))
{
// start a session and store the username, password and userID from the users database.
if ($rememberme == "on")
{
$expire = (time() + 630720000);
setcookie("username", $username, $expire);
setcookie("password", base64_encode($password), $expire);
setcookie("userID", $row['userID'], $expire);
print "<SCRIPT LANGUAGE=\"JavaScript\">window.location=\"index.php\";</script>;";
}
else
{
setcookie("username", $username);
setcookie("password", base64_encode($password));
setcookie("userID", $row['userID']);
print "<SCRIPT LANGUAGE=\"JavaScript\">window.location=\"index.php\";</script>;";
}
}
// failed login attempt, head back to index
else
{
$location = "Location: index.php?login=failed";
header($location);
}
}
// form never submitted, head back to index
else
{
header("Location: index.php");
}
?>
😃