NoamB/sorcery — pull request #585 by arnvald (2014-07-16 02:24:20+00:00)
Title: Store user_id in session as string

Currently we store in session `user.id` which in some cases is integer, but in
some cases (like Mongoid) is an object.
What's the problem with storing object? First thing, it might break
compatibility between different ORM versions (Mongoid changed class of this
object from v2 to v3). Second, the bigger issue, is that new serializer in Rails
uses JSON instead of YAML, so it can store only selected types, and it parses
custom objects incorrectly, which may break the authentication feature.

This commit changes the way we store user id to plain string. This will make it
being stored correctly no matter what serializer is used.

This should not break compatibility, so it should be ok to merge it to the next tiny version - we only change the way we save sessions, not the way we retrieve them, so the old ones will be handled old way and the new ones will be saved new way.