class

Lucky::CookieJar

Inherits Habitat::SettingsHelpers < Habitat::TempConfig < Reference < Object

Constants

HABITAT_SETTINGS = [{decl: on_set : (HTTP::Cookie -> HTTP::Cookie) | ::Nil, example: nil, validation: nil}] of Nil
LUCKY_ENCRYPTION_PREFIX = (Base64.strict_encode("lucky")) + "--"
MAX_COOKIE_SIZE = 4096

Class methods

configure
Source
empty_jar
Source
from_request_cookies(cookies : HTTP::Cookies) : Lucky::CookieJar
Source
settings
Source

Instance methods

[](key : Key) : String
Source
[]?(key : Key) : String | Nil
Source
clear

Delete all cookies.

Source
delete(key : Key) : Nil

https://tools.ietf.org/search/rfc6265#page-8 to remove a cookie, the server returns a Set-Cookie header with an expiration date in the past. The server will be successful in removing the cookie only if the Path and the Domain attribute in the Set-Cookie header match the values used when the cookie was created.

Source
delete(key : Key, &) : Nil

Delete a specific cookie by name key. Yield that cookie to the block so you can add additional options like domain, path, etc...

Source
deleted?(key : Key) : Bool

Returns true if the cookie has been expired, and has no value. Will return false if the cookie does not exist, or is valid.

Source
get(key : Key) : String
Source
get?(key : Key) : String | Nil
Source
settings
Source
updated
Source

Nested types