Module: Roda::RodaPlugins::Cookies::ResponseMethods
- Defined in:
- lib/roda/plugins/cookies.rb
Instance Method Summary collapse
-
#delete_cookie(key, value = {}) ⇒ Object
Modify the headers to include a Set-Cookie value that deletes the cookie.
-
#set_cookie(key, value) ⇒ Object
Set the cookie with the given key in the headers.
Instance Method Details
#delete_cookie(key, value = {}) ⇒ Object
Modify the headers to include a Set-Cookie value that deletes the cookie. A value hash can be provided to override the default one used to delete the cookie. Example:
response.('foo')
response.('foo', :domain=>'example.org')
21 22 23 |
# File 'lib/roda/plugins/cookies.rb', line 21 def (key, value = {}) ::Rack::Utils.(@headers, key, value) end |
#set_cookie(key, value) ⇒ Object
Set the cookie with the given key in the headers.
response.('foo', 'bar')
response.('foo', :value=>'bar', :domain=>'example.org')
29 30 31 |
# File 'lib/roda/plugins/cookies.rb', line 29 def (key, value) ::Rack::Utils.(@headers, key, value) end |