Public Instance methods
delete_cookie(key, value = {})
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.delete_cookie('foo') response.delete_cookie('foo', domain: 'example.org')
[show source]
# File lib/roda/plugins/cookies.rb 34 def delete_cookie(key, value = {}) 35 ::Rack::Utils.delete_cookie_header!(@headers, key, roda_class.opts[:cookies_opts].merge(value)) 36 end
set_cookie(key, value)
Set the cookie with the given key in the headers.
response.set_cookie('foo', 'bar') response.set_cookie('foo', value: 'bar', domain: 'example.org')
[show source]
# File lib/roda/plugins/cookies.rb 42 def set_cookie(key, value) 43 value = { :value=>value } unless value.respond_to?(:keys) 44 ::Rack::Utils.set_cookie_header!(@headers, key, roda_class.opts[:cookies_opts].merge(value)) 45 end