dagolden/Session-Storage-Secure — pull request #4 by garu (2014-04-19 04:51:07+00:00)
Title: store objects as unblessed references, stringifies unknown/unsupported.

Hi David!

In https://github.com/PerlDancer/Dancer-Plugin-Auth-Twitter/pull/13#issuecomment-40857473, you suggested:

"If there's a way to get Sereal to stringify classes, I'm open to implementing that, but I don't currently have the tuits to investigate."

So I went ahead and implemented it :)

I also tested it against my twitter auth code and it worked flawlessly, without the need to patch Dancer::Plugin::Auth::Twitter at all!

This fixes the issue properly, I think. As I've written in the pod, it serializes blessed references as the reference itself. I also added the 'strinfigy_unknown' property of Sereal::Encoder, which will stringify any unknown or unsupported data structures instead of throwing an exception.

As a side-effect of not throwing exceptions anymore, I removed t/errors.t as it had zero tests.

I also tried my best to follow the contribution guidelines, running "tidyall" on the generated code.

Hope this helps! Thanks again for all the cool stuff that you create :D