class Rack::Protection::EncryptedCookie::Base64::ZipJSON

Public Instance Methods

decode(str) click to toggle source
# File lib/rack/protection/encrypted_cookie.rb, line 115
def decode(str)
  return unless str

  ::JSON.parse(Zlib::Inflate.inflate(super(str)))
rescue StandardError
  nil
end
encode(obj) click to toggle source
# File lib/rack/protection/encrypted_cookie.rb, line 111
def encode(obj)
  super(Zlib::Deflate.deflate(::JSON.dump(obj)))
end