Class

CookieStore

Extends:

If you have more than 4K of session data or don’t want your data to be visible to the user, pick another session store.

CookieOverflow is raised if you attempt to store more than 4K of data. TamperedWithCookie is raised if the data integrity check fails.

A message digest is included with the cookie to ensure data integrity: a user cannot alter session data without knowing the secret key included in the hash.

To use Cookie Sessions, set in config/merb.yml

:session_secret_key - your secret digest key
:session_store: cookie
Classes
CookieOverflow Raised when storing more than 4K of session data.
TamperedWithCookie Raised when the cookie fails its integrity check.
Constants
DIGEST
MAX Cookies can typically store 4096 bytes.
Public Attributes
data
Public Methods
[]
[]= assigns a key value pair
each
new
read_cookie return a cookie value. raises CookieOverflow if session contains too much information
Private Methods
generate_digest Generate the HMAC keyed message digest. Uses SHA1.
marshal Marshal a session hash into safe cookie data. Include an integrity hash.
method_missing
unmarshal Unmarshal cookie data to a hash and verify its integrity.
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.