The redis storage session is configured in Laravel
But the question is how to set the session to expire after a week, preferably in the early morning at night?
In addition, after the user logs out, use forget to find that the session in redis still exists
Also, how do I use sessionid to get session information from redis
Question 1: How to set the session to expire after a week, preferably in the early hours of the night?
Answer: The config/session.php
中有lifetime
parameter in the project root directory indicates the expiration time in minutes, more specifically until the early hours of the night. This is difficult to handle;
Question 2: After the user logs out, use forget to find that the session in redis still exists?
Answer: Question, take a look at your forget
語句怎么寫的呢?要不試試destory
方法;參考參考IlluminateSessionCacheBasedSessionHandler.php
code;
Question 3: How to get session information from redis?
Answer: read method, replace sessionId
作參數(shù)傳入;同樣參考IlluminateSessionCacheBasedSessionHandler.php
;