diff options
Diffstat (limited to 'lib/xmlrpc')
-rw-r--r-- | lib/xmlrpc/client.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/xmlrpc/client.rb b/lib/xmlrpc/client.rb index 547eca8819..f213fdf8d1 100644 --- a/lib/xmlrpc/client.rb +++ b/lib/xmlrpc/client.rb @@ -515,10 +515,16 @@ module XMLRPC # :nodoc: return if set_cookies.nil? return if set_cookies.empty? require 'webrick/cookie' - @cookie = set_cookies.collect do |set_cookie| + pairs = {} + set_cookies.each do |set_cookie| cookie = WEBrick::Cookie.parse_set_cookie(set_cookie) - WEBrick::Cookie.new(cookie.name, cookie.value).to_s - end.join("; ") + pairs.delete(cookie.name) + pairs[cookie.name] = cookie.value + end + cookies = pairs.collect do |name, value| + WEBrick::Cookie.new(name, value).to_s + end + @cookie = cookies.join("; ") end def gen_multicall(methods=[], async=false) |