Session Payload Size Issue with Database Driver #53333
Unanswered
faisal975Hexolt
asked this question in
Ideas
Replies: 1 comment
-
I noticed the issue was caused by a try/catch block in the database session handler, which silently suppresses the error: Improving this behavior could greatly benefit developers by providing more explicit feedback on why session data isn't being saved correctly. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel Version
11
PHP Version
8.2.12
Database Driver & Version
No response
Description
I recently switched my session driver from "file" to "database," and I encountered a frustrating issue where I was losing sessions soon after login. I spent three days troubleshooting the code, unable to pinpoint the problem.
After much investigation, I discovered that the session payload was larger than the allowable size of the text field in the sessions table in the database. Instead of throwing an SQL error, the framework silently saved an incomplete payload string, which rendered it useless.
I believe it would be beneficial for future developers to address this issue. It would be more helpful if Laravel could provide an SQL error when the session payload exceeds the maximum size for the database field, preventing the saving of incomplete session data.
I hope this feedback helps improve the framework for others.
Steps To Reproduce
add some more data in session a part from authentiaction that could not fit in sessions.payload
Beta Was this translation helpful? Give feedback.
All reactions