Hi,
I noticed that while storing cookies for URL with IPv6 address (i.e. http://[::1]/foo), tough-cookie stores domain name without [ ] (i.e. ::1) in the store. It should store the domain as it is like Chrome does (i.e. [::1]).
Because of this behavior, I get error Error: Cookie not in this host's domain. Cookie:[::1] Request:::1 while executing following code snippet:
var tough = require('tough-cookie');
var jar = new tough.CookieJar();
var cookieString = 'my_cookie=hello_world; path=/; domain=[::1]; Expires=Sat, 11 May 2019 11:05:21 GMT;';
var url = 'http://[::1]/';
jar.setCookie(cookieString, url, (e) => {
console.log(e)
});