Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mathewparet's avatar

Anyone facing SESSOIN related issues when deployed on Laravel Cloud?

I am having issues with Laravel Cloud.

First Issue

The default SESSION_DRIVER for Laravel Cloud is cookie. With this setting return back()->with('flash... doesn't seem to work always (works for some part of the code, doesn't work for others).

But when I set SESSION_DRIVER to database everything works just fine.

Second Issue

My app supports Passkey. On Laravel Cloud, regardless of the session driver, login works sometimes, and sometimes not - totally random. Seems like the the challenge stored in the session goes missing somehow.

The same app had no issue when I ran the applicaion on my own VPS on DO.

Interestingly, neither of these issues exist when Autoscaling is off. I would have assumed SESSION_DRIVER being database or config would be the right way to store session data when auto scaling is on.

Also, weidrly, when the app threw 500 error due to session data missing, this wasn't logged in the log section. So I had to temporarily enable APP_DEBUG to catch it.

1 like
6 replies
sameed_editz's avatar

isnt session driver file or cookie same? i had mine set to file and everthing worked tho

mathewparet's avatar

@sameed_editz No, it changes where the session are managed. With Session cookie, the session details are in a cookie on your browser, and with the file driver the session details are stored as a file on the server.

SerhiiKorniienko's avatar

Had the same issue. Scaling is on and by default, SESSION_DRIVER was set to cookie. It wasn't working, up until I switched to redis.

MrMoto9000's avatar

Yes! I have this issue too. Was driving me crazy. Something weird going on with Laravel Cloud if you're using Cookies for sessions. Maybe a browser issue, but still it wasn't expected.

ArthurYdalgo's avatar

I had an issue where after a few visited pages I'd get a "400 Bad Request request header or cookie too large".

I switched SESSION_DRIVER from cookie to redis and it started working again.

Please or to participate in this conversation.