1
votes

We deployed a project in production, using redis for session driver. The problem is that the old values, the success and error messages are not displayed everytime (they appear sometimes but very rarely).

In development, everything works fine, old values are presents, same for success and error messages.

We tried to change session driver, session domain ...

In 'config/session.php'

'driver' => env('SESSION_DRIVER', 'file'),

'domain' => env('SESSION_DOMAIN', null),

In '.env'

SESSION_DRIVER=redis
SESSION_DOMAIN=<our_website_url>

Any idea to fix this ?

Thank you in advance for your anwser !

[EDIT]
We noticed that the flash works on the login page but not after login successed. So the old data and the error message work both on the login fail.

1
Hi, do you have any configuration or code to share ? This is too broad :/ - Maelig
This might happen if you've set up permanent redirects within the Laravel application for example if you are using middleware to force HTTPS connections or similar. If such middleware run after the session starts then when the redirect response is sent the flash messages are aged and therefore get deleted. Without further information on how this is reproduced though we can't really speculate - apokryfos
I added some code on our session config, maybe it comes from apache which redirect http to https ? - Vincent Creusy

1 Answers

0
votes

We just solved this issue.

It was not a laravel issue, but a server bad configuration.