rack-session icon indicating copy to clipboard operation
rack-session copied to clipboard

Support UTF-8 data when using the JSON serializer

Open jcmfernandes opened this issue 1 year ago • 3 comments

Closes #38

jcmfernandes avatar Feb 13 '24 00:02 jcmfernandes

The specs don't cover the setup V1 encryptor+JSON serializer. I feel this is OK now, as the V1 encryptor is battle-tested. I'm happy to hear otherwise.

Somewhat related: assuming that most use the default V1 serializer - Marshal - it's important to note that the JSON serializer can introduce subtle changes. A key one is that it transforms symbols into strings. This leads me to the question: should we default to the V2 encryptor in the next release or make it opt-in instead?

jcmfernandes avatar Feb 13 '24 00:02 jcmfernandes

We could consider using symbolize_names or similar when using JSON. I think it's less surprising in most cases.

ioquatix avatar Feb 13 '24 00:02 ioquatix

We could consider using symbolize_names or similar when using JSON. I think it's less surprising in most cases.

We could. The bigger point is that small differences are unavoidable. We could also support Marshal in encryptor V2. I deliberately stayed away from it, but it's a decision we can revisit.

jcmfernandes avatar Feb 13 '24 17:02 jcmfernandes

Thanks for persisting with this, I'll review it today.

ioquatix avatar Aug 10 '24 22:08 ioquatix