php - Laravel uses redis to store sessions
给我你的怀抱
给我你的怀抱 2017-05-17 09:55:24
0
1
717

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

给我你的怀抱
给我你的怀抱

reply all(1)
给我你的怀抱

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作参数传入;同样参考IlluminateSessionCacheBasedSessionHandler.php;

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template