What should be stored in a cookie for a login system?

前端 未结 4 1638
予麋鹿
予麋鹿 2020-12-15 10:07

What is the best thing to store in a cookie to keep a persistent logged-in state?

I have seen many websites (and beginner tutorials!) that simply store something lik

4条回答
  •  盖世英雄少女心
    2020-12-15 10:32

    Best practice would be to use a SESSION instead of a COOKIE for use data. COOKIES are used to store generic information not specific information about a user, that's what SESSIONS are used for.

提交回复
热议问题