Support Rails 4.1 JSON encoding of sessions.

Continues to support marshalled sessions.