Modify the session serializer implementation

Rename allowed options to :marshal and :json, for custom serializers
only allow the use of custom classes.
Merge pull request #13888 from rails/session-serializer

Modify the session serializer implementation