Skip to content

Instantly share code, notes, and snippets.

@wycats
Created August 22, 2008 15:37
Show Gist options
  • Save wycats/6801 to your computer and use it in GitHub Desktop.
Save wycats/6801 to your computer and use it in GitHub Desktop.
def to_headers
kookie = ""
self.each do |name, value|
options = @_cookie_defaults.merge(@_options_lookup[name] || {})
secure = options.delete(:secure)
kookie << "#{name}=#{Merb::Request.escape(value)}; "
options.each {|k, v| kookie << "#{k}=#{v}; " }
kookie << 'secure' if secure
end
{ 'Set-Cookie' => [kookie] }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment