# File lib/rack/request.rb, line 197 197: def cookies 198: return {} unless @env["HTTP_COOKIE"] 199: 200: if @env["rack.request.cookie_string"] == @env["HTTP_COOKIE"] 201: @env["rack.request.cookie_hash"] 202: else 203: @env["rack.request.cookie_string"] = @env["HTTP_COOKIE"] 204: # According to RFC 2109: 205: # If multiple cookies satisfy the criteria above, they are ordered in 206: # the Cookie header such that those with more specific Path attributes 207: # precede those with less specific. Ordering with respect to other 208: # attributes (e.g., Domain) is unspecified. 209: @env["rack.request.cookie_hash"] = 210: Utils.parse_query(@env["rack.request.cookie_string"], ';,').inject({}) {|h,(k,v)| 211: h[k] = Array === v ? v.first : v 212: h 213: } 214: end 215: end