I've been having an issue with Laravel sessions while logging in.
1.Yes, I do have a CSRF token included in my form.
2.Yes, the token has not expired.
3.Yes, the SESSION_SECURE_COOKIE is set to false.
I'm using redis
as my SESSION_DRIVER
and the expiration time
is set to 120 minutes
.
The thing that bothers me the most is that 'sometimes it works, and sometimes it does not'.
If I were to open an incognito tab and try to login, 10/20 times it would work without any problems whatsoever, yet the other 10 would result in a
[419 | Session Expired] error
.
My environment is CentOS
, Nginx
.
There aren't any proxies, and I'm not using Cloudflare either.
I'm really flabbergasted because the behavior is not consistent, it's literally random behavior which results in a successful or an unsuccessful login.
Does anyone have any ideas what might be the case?