Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v2.3.8) is shown here.
These similar methods exist in v7.1.3.2:
parse(raw_cookie)
public
Parses a raw cookie string into a hash of cookie-name =>
cookie-object pairs.
cookies = CGI::Cookie::parse("raw_cookie_string")
Show source
def self.parse(raw_cookie)
cookies = Hash.new([])
if raw_cookie
raw_cookie.split(/;\s?/).each do |pairs|
name, value = pairs.split('=',2)
next unless name and value
name = CGI::unescape(name)
unless cookies.has_key?(name)
cookies[name] = new(name, CGI::unescape(value))
end
end
end
cookies
end