PHP empty session files generated by login system

前端 未结 4 1787
忘了有多久
忘了有多久 2021-01-11 22:48

Recently I\'ve noticed that many blank sessions are being created, I\'m not sure why though as I believe I\'m doing everything the correct way.

At the moment we crea

4条回答
  •  我在风中等你
    2021-01-11 23:11

    bool session_regenerate_id([bool $delete_old_session = false]);
    

    view php manual for more information.

    session_regenerate_id() will replace the current session id with a new one, and keep the current session information.

    the old session file is kept and a new session file is generated every time that session_register_id() is ran. session_register_id() creates a new session with a new session_id but retains the old session information, so yes, your session_register_id() is keeping the old session files to null after updating the information to the new session file.

提交回复
热议问题