Kurtismonger
Kurtismonger

Reputation: 43

RoR JSON::ParserError 743: unexpected token

After upgrading my app from RoR 4.0.3 to 4.2.11.1 I'm getting the following error in production on Heroku. Development works fine.

JSON::ParserError (743: unexpected token at I"session_id:ETI"%bd13343a4bb8069dd3c3420aba52289c;'):

This is my first time upgrading a RoR app so I followed the Rails Guide and stepped through rake rails:update process, updating the files as required.

Upvotes: 0

Views: 146

Answers (1)

infused
infused

Reputation: 24337

According to the upgrade guide:

Applications created before Rails 4.1 uses Marshal to serialize cookie values into the signed and encrypted cookie jars. If you want to use the new JSON-based format in your application, you can add an initializer file with the following content:

Rails.application.config.action_dispatch.cookies_serializer = :hybrid

This would transparently migrate your existing Marshal-serialized cookies into the new JSON-based format.

Upvotes: 1

Related Questions