search

Home  >  Q&A  >  body text

php - Laravel front-end and back-end separation. How to operate after the client sends the sessionid?

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

阿神阿神2796 days ago949

reply all(1)I'll reply

  • 世界只因有你

    世界只因有你2017-05-18 10:50:14

    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 session

    Pay 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

    reply
    0
  • Cancelreply