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

前端 未结 6 1497
夕颜
夕颜 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:19

    It wouldn't hurt to have some kind of "password" in the cookie along with a user id (to prevent users from changing the uid to that of another user), just don't make the "password" the same as the actual user's password.

    And just because it's a hash doesn't necessarily mean it's one-way (well, by definition it does, but there are utilities to generate MD5 plaintexts and I would guess it's only a matter of time before it happens to others). I would hash some kind of secondary password.

提交回复
热议问题