Hi,
I asked a question about Tokens earlier. After debugging I've found the reason as to why my program isn't working. It's related to this statement:
$token is generated in form using md5(uniqid()). When I echo both $token and $_SESSION['token'] before the if statement they both turn out to be the same. Yet for some reason the if statement is not being satisfied and is not returning true as it's supposed to do. (I've tried $token === $_SESSION['token'] as well.) I don't know if some kind of type casting or other is required for the conditional statement to work. Would be grateful for any suggestions.
I asked a question about Tokens earlier. After debugging I've found the reason as to why my program isn't working. It's related to this statement:
Code:
if($token == $_SESSION['token'])
{ ........;
return true;
}
$token is generated in form using md5(uniqid()). When I echo both $token and $_SESSION['token'] before the if statement they both turn out to be the same. Yet for some reason the if statement is not being satisfied and is not returning true as it's supposed to do. (I've tried $token === $_SESSION['token'] as well.) I don't know if some kind of type casting or other is required for the conditional statement to work. Would be grateful for any suggestions.