Module: Merb::CookiesMixin
- Defined in:
- lib/merb-core/dispatch/cookies.rb
Defined Under Namespace
Modules: RequestMixin
Class Method Summary collapse
Instance Method Summary collapse
-
#cookies ⇒ Object
Returns Merb::Cookies:: A new Merb::Cookies instance representing the cookies that came in from the request object.
Class Method Details
.included(base) ⇒ Object
96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/merb-core/dispatch/cookies.rb', line 96 def self.included(base) # Allow per-controller default cookie domains (see callback below) base.class_inheritable_accessor :_default_cookie_domain base. = Merb::Config[:default_cookie_domain] # Add a callback to enable Set-Cookie headers base._after_dispatch_callbacks << lambda do |c| headers = c.request..extract_headers("domain" => c.) c.headers.update(headers) end end |
Instance Method Details
#cookies ⇒ Object
Returns
- Merb::Cookies
-
A new Merb::Cookies instance representing the cookies that came in from the request object
Notes
Headers are passed into the cookie object so that you can do:
[:foo] = "bar"
:api: public
118 119 120 |
# File 'lib/merb-core/dispatch/cookies.rb', line 118 def request. end |