Skip to content

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

Closed
Krisell wants to merge 1 commit into
laravel:9.xfrom
Krisell:tests/session-json-serialization
Closed

[9.x] Add tests for session JSON serialization#41850
Krisell wants to merge 1 commit into
laravel:9.xfrom
Krisell:tests/session-json-serialization

Conversation

@Krisell

@Krisell Krisell commented Apr 6, 2022

Copy link
Copy Markdown
Contributor

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

Krisell commented Apr 6, 2022

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Member

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

@Krisell

Krisell commented Apr 6, 2022

Copy link
Copy Markdown
Contributor Author

@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