In my login script I calculate a value with md5
and then store that in a database. The id for that row is stored in a cookie on the clients computer. However, the value of the cookie is 1 lower then the actual value. What's causing this?
$cookie = md5($_SERVER['REMOTE_ADDR']+$member['username']+$salt)
$tkn = "INSERT INTO cookies (token) VALUES ('$cookie')";
$tknqry = mysql_query($tkn) or die(mysql_error());
$cookievalue = mysql_insert_id();
setcookie("token", $cookievalue, time()+2678400);