Separation of front-end and back-end of the project
After logging in, use laravel's session to store the information in redis, get the sessionid and return it to the client
How can I use the sessionid to get the session information in redis after the client sends the sessionid next time? , it seems that using the get method of session directly can only pass the key name when storing the session
Implement an http middleware by yourself, get the sessionid from the client in the middleware and then call the
session_id()
function to set the sessionid document of the current sessionPay attention to the location of the middleware you customized. It should definitely be in front of the middleware that relies on session such as authentication