duan4523 2019-02-02 23:25
浏览 110

创建新的会话ID后,PHP session_start()会读取

I have a class that implements my own SessionHandlerInterface that stores sessions in a remote Redis server. One thing I noticed is that session_start() always executes a read even if a cookie with name PHPSESSID was NOT recieved. If it just generated a new sessionId, why attempt to check if it exists? Surely it's not present. This seems like an unecessary trip to my Redis session manager. I'm curious if I'm misunderstanding this or if there's a way to override this behavior and only read a session from Redis if a PHPSESSID cookie was received.

  • 写回答

0条回答 默认 最新

    报告相同问题?