Cookies/Sessions login system

后端 未结 4 1521
眼角桃花
眼角桃花 2021-02-08 15:20

When a user logins I get him/her\'s ID and save it in a session var. What I wonder is, is this the way to go? Or should I use cookies? so it automatically login and so on.

4条回答
  •  有刺的猬
    2021-02-08 15:44

    Cookies can be manipulated very easily. Manage login/logout with Sessions. If you want, you can store the users emailaddress/username in a cookie, and fill the username box for them the next time they visit after the present session has expired.

提交回复
热议问题