Quoting The Ultimate Form-Based Authentication Guide :
DO NOT START THE STANDING FOLLOWING AGREEMENT (TOKEN) IN YOUR DATABASE, ONLY THIS IT IS! Login current is the equivalent of a password, so if an attacker gained access to your database, he could use tokens to log into any account, just as if they were a cleartext login-password combination. Therefore, use strong salt hashing (bcrypt / phpass) while maintaining constant input tokens .
I agree with the first bold sentence, but not the last.
If I'm not mistaken, the purpose of the strong salt hashing algorithm is that someone should not extract passwords based on the rainbow table.
But here the hashed string is not a password, but a random string . Therefore, it is rather unlikely that any rainbow table could receive any initially hashed string. I even suggest that I could just use a basic hash('sha256', $randomString) call hash('sha256', $randomString) for this, the goal was to have different values ββfor the token in the database and in the cookie.
source share