Module: Merb::CookiesMixin::RequestMixin

Defined in:
lib/merb-core/dispatch/cookies.rb

Instance Method Summary collapse

Instance Method Details

#cookiesObject

Returns

Hash

The cookies for this request.

Notes

If a method #default_cookies is defined it will be called. This can be used for session fixation purposes for example. The method returns a Hash of key => value pairs.

:api: public


133
134
135
136
137
138
139
140
# File 'lib/merb-core/dispatch/cookies.rb', line 133

def cookies
  @cookies ||= begin
    values  = Merb::Parse.query(@env[Merb::Const::HTTP_COOKIE], ';,')
    cookies = Merb::Cookies.new(values)
    cookies.update(default_cookies) if respond_to?(:default_cookies)
    cookies
  end
end