To be compatible to Rails 4.1 Cookie specification (JSON-based)

Time object should be converted to String before setting to a Cookie.
http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#cookies-serializer