Skip to content

Session Payload Size Issue with Database Driver #53277

@faisal975Hexolt

Description

@faisal975Hexolt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions