Index: lib/webrick/cookie.rb =================================================================== --- lib/webrick/cookie.rb (revision 17538) +++ lib/webrick/cookie.rb (working copy) @@ -77,7 +77,7 @@ end def self.parse_set_cookie(str) - cookie_elem = str.split(/;/) + cookie_elem = str.split(/;+/) first_elem = cookie_elem.shift first_elem.strip! key, value = first_elem.split(/=/, 2) Index: test/webrick/test_cookie.rb =================================================================== --- test/webrick/test_cookie.rb (revision 17538) +++ test/webrick/test_cookie.rb (working copy) @@ -71,6 +71,15 @@ assert_equal(true, cookie.secure) end + def test_parse_set_cookie_extra_semicolon + data = %(WSIDC=WEST;; domain=.tenderlovemaking.com; path=/) + cookie = WEBrick::Cookie.parse_set_cookie(data) + assert_equal('WSIDC', cookie.name) + assert_equal('WEST', cookie.value) + assert_equal("/", cookie.path) + assert_equal(".tenderlovemaking.com", cookie.domain) + end + def test_parse_set_cookies data = %(Shipping="FedEx"; Version="1"; Path="/acme"; Secure) data << %(, CUSTOMER=WILE_E_COYOTE; path=/; expires=Wednesday, 09-Nov-99 23:12:40 GMT; path=/; Secure)