Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Writing cookies: Prefix wildcard domains with "."

If a cookie matches a wildcard domain, e.g. "(anything)",
then the line written out to a Netscape-formatted cookies.txt file must
begin with a dot, e.g. "" not "".  This is
redundant with the second field of the line, a TRUE/FALSE value
indicating whether the domain is a wildcard, but that's the way it goes.
  • Loading branch information...
commit dae27334815082e228cfd344e2452a17121f6847 1 parent 7c49ee0
@mmorearty mmorearty authored Mike Morearty committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/mechanize/cookie_jar.rb
2  lib/mechanize/cookie_jar.rb
@@ -192,7 +192,7 @@ def dump_cookiestxt(io)
to_a.each do |cookie|
- cookie.domain,
+ (cookie.for_domain? ? "." : "") + cookie.domain,
cookie.for_domain? ? "TRUE" : "FALSE",
cookie.path, ? "TRUE" : "FALSE",
Please sign in to comment.
Something went wrong with that request. Please try again.