How do I create persistent sessions in PHP?

后端 未结 4 422
长发绾君心
长发绾君心 2020-11-29 03:56

I used session_start() to initiate a session in PHP, but when my browser closes, the session is gone.

How do I use PHP to create persistent sessions tha

4条回答
  •  青春惊慌失措
    2020-11-29 04:39

    I would recommend using cookies and a database if you want a persistent session. We store the customer's ID (random 32 bit alph-anumeric value) in a cookie and then reference that to load up their customer information.

提交回复
热议问题