3

So I have Laravel project and Redis. SESSION_DRIVER in my project .env file is currently set to file. I want to change it to array, but when I do so, the project stops working properly: I get logged off, and when I log in, I get redirected back to login page, being logged off again and again. What actions should I take to fix this and make my project work correctly with array session driver?

2
  • 2
    Are you sure you don't want to set SESSION_DRIVER to "redis" instead? The array driver doesn't persist across requests, so isn't ever going to keep you logged in. Commented May 18, 2016 at 14:42
  • the array driver is for testing only. change that to redis if u are not testing Commented May 18, 2016 at 14:48

1 Answer 1

3

You may want to read up on the session documentation here. It specifically states that when using the array driver:

array - sessions are stored in a simple PHP array and will not be persisted across requests.

Since the session does not persist, you will not be able to log in. Basically, the array session driver is solely for testing purposes.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.