flash doesn't pass objects #15522 [ci skip]

#15522
Hashes and arrays also works so it is not only strings. Maybe primitive types like `string`, `hashes` and `arrays`. Of course you can still put any object you want. You only need to change the cookie serializer to marshal.