Is it advisable to store a hashed password in a cookie?

前端 未结 6 1547
夕颜
夕颜 2021-01-04 01:58

I want user\'s to be able to select a \"remember me\" box on my website so they need not log in each time they come. So, I need to store a unique ID in a cookie to identify

6条回答
  •  星月不相逢
    2021-01-04 02:03

    Remember, the hash of the password is effectively the same as their password. Somebody who stole the hash would have the same access to the user's account as if they had stolen their password. Therefore it is not advisable to store a hash of the user's password in a cookie unless there was some other information not stored with the cookie that is used to authenticate (i.e. 2-factor authentication).

提交回复
热议问题