keep user logged in when he visit the same page again?

后端 未结 4 1074
余生分开走
余生分开走 2021-02-06 14:47

currently im using session to log in the user. but when i close the browser and open it again i have to log in again. how do you keeo the user logged in in lets say 2 weeks.

4条回答
  •  轮回少年
    2021-02-06 15:16

    Yes, you should do that using cookies. Here's the manual entry: http://php.net/manual/en/features.cookies.php

    Alternately, you can take a look at this function: http://php.net/manual/en/function.session-set-cookie-params.php. It allows you to modify session cookie settings like its lifetime...

提交回复
热议问题