Class: Rack::Protection::EncryptedCookie::Base64

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/protection/encrypted_cookie.rb

Overview

Encode session cookies as Base64

Direct Known Subclasses

JSON, Marshal, ZipJSON

Defined Under Namespace

Classes: JSON, Marshal, ZipJSON

Instance Method Summary collapse

Instance Method Details

#decode(str) ⇒ Object



71
72
73
# File 'lib/rack/protection/encrypted_cookie.rb', line 71

def decode(str)
  str.unpack1('m')
end

#encode(str) ⇒ Object



67
68
69
# File 'lib/rack/protection/encrypted_cookie.rb', line 67

def encode(str)
  [str].pack('m0')
end