lib/htty/request.rb
# Removes the last element of #cookies having the specified _name_.
Removes the last element of #cookies having the specified _name_.
Removes the last element of #cookies having the specified _name_ .
def cookie_remove(name)
    return dup_without_response.cookie_remove(name) if response
    rejected = false
    new_cookies = cookies.reverse.reject { |cookie_name, cookie_value|
      if !rejected && (cookie_name == name)
        rejected = true
      else
        false
      end
    }.reverse
    cookies_string = HTTY::CookiesUtil.cookies_to_string(new_cookies)
    if cookies_string
      @headers[COOKIES_HEADER_NAME] = cookies_string
    else
      @headers.delete COOKIES_HEADER_NAME
    end
    self
  end
def cookie_remove ( name ) return dup_without_response . cookie_remove ( name ) if response rejected = false new_cookies = cookies . reverse . reject { | cookie_name , cookie_value | if ! rejected && ( cookie_name == name ) rejected = true else false end } . reverse cookies_string = HTTY :: CookiesUtil . cookies_to_string ( new_cookies ) if cookies_string @headers [ COOKIES_HEADER_NAME ] = cookies_string else @headers . delete COOKIES_HEADER_NAME end self end
Removes the last element of #cookies having the specified _name_.
Removes the last element of #cookies having the specified _name_ .
# Remove just one matching cookie from the end.
name