Skip to content

[9.x] Add tests for session JSON serialization #41850

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

Krisell
Copy link
Contributor

@Krisell Krisell commented Apr 6, 2022

This adds tests for the new session JSON serialization option added in Laravel 9 (#40595).

The added tests does not duplicate all test cases for serialize/unserialize, but they do test both reading and writing to the session.

@Krisell
Copy link
Contributor Author

Krisell commented Apr 6, 2022

Should the new JSON serialization option be added to the documentation (e.g. here https://laravel.com/docs/9.x/session#configuration) or should the serialization option perhaps be mentioned in the config/session.php template?

@taylorotwell
Copy link
Member

@Krisell JSON serialization is totally broken for view error bag sharing and should probably be removed.

@Krisell
Copy link
Contributor Author

Krisell commented Apr 6, 2022

@taylorotwell I did see your comment here now, and the related issue: laravel/laravel#5796 (comment)

Has your suggested solution there been attempted?

I think using JSON is preferred for several reasons, as described by you in laravel/laravel#5787 and also for the smaller payload size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants