
February 15th, 2003, 05:20 AM
|
|
Contributing User
|
|
Join Date: Dec 2002
Location: Melbourne, Australia
Posts: 97
Time spent in forums: 23 m 33 sec
Reputation Power: 6
|
|
Building a Members Area With PHP: Part 4/6. CheckCooking prob
Hi,
The login script and creating a session and cookie all work. But when a user checks "remember me", they will get a cookie with the sessionid, but in the CheckCookie() function will stop at the following line:
PHP Code:
//cookie session = stored session, login
$result = mysql_fetch_array($strQuery);
//echo $result['sessionid'];
if($dtlsSecurity->StoreSession($result[0], $result[1], $result[3], "{$result[4]},{$result[5]}")) <- STOPS AT THIS LINE
header("Location: index.php");
}
I also discovered that when you alter the users Table to add the "sessionid" column, you use:
PHP Code:
ALTER TABLE `users` ADD `sessionid` VARCHAR(255) NOT NULL;
but in the CheckCookie() function sqlQuery it reads:
PHP Code:
$strQuery = mysql_query("SELECT * FROM users WHERE session = '{$_COOKIE['mem']}'");
session should become sessionid,
anyway i would appreciates some help with why i get stuck at the marked line above, thanks
__________________
regards,
Fulton
|