Class: Merb::Cookies

Class | Merb::Cookies
In: | lib/merb-core/dispatch/cookies.rb
Parent: | Mash

### Methods

[]= delete extract_headers new set_cookie

### Public Class methods

new(constructor = {})

:api: private

### Public Instance methods

[]=(key, value)

Implicit assignment of cookie key and value.

#### Parameters

name<~to_s>: | Name of the cookie.
value<~to_s>: | Value of the cookie.

#### Notes

By using this method, a cookie key is marked for being included in the Set-Cookie response header.

:api: public

delete(name, options = {})

Removes the cookie on the client machine by setting the value to an empty string and setting its expiration date into the past.

#### Parameters

name<~to_s>: | Name of the cookie to delete.
options<Hash>: | Additional options to pass to `set_cookie`.

:api: public

extract_headers(controller_defaults = {})

Generate any necessary headers.

#### Returns

Hash: | The headers to set, or an empty array if no cookies are set.

:api: private

set_cookie(name, value, options = {})

Explicit assignment of cookie key, value and options

#### Parameters

name<~to_s>: | Name of the cookie.
value<~to_s>: | Value of the cookie.
options<Hash>: | Additional options for the cookie (see below).

#### Options (options)

:path<String>: | The path for which this cookie applies. Defaults to "/".
:expires<Time>: | Cookie expiry date.
:domain<String>: | The domain for which this cookie applies.
:secure<Boolean>: | Security flag.

#### Notes

By using this method, a cookie key is marked for being included in the Set-Cookie response header.

:api: private

[Validate]