Do you know if a Javascript library to handle cookies exists, that is mature and can work without a browser? In other words I only want the cookie logic that is included in the web browsers and HTTP clients and following the current standards, and the cookies are stored and retrieved from a private store.
I think the library can only contain get/set methods. The set method set cookies that came from the "Set-Cookie" HTTP header and the get method returns a list of cookies to send in the "Cookie" header for a specific host (or domain). The get method would need to receive a host as a parameter too, since return an error or something if a host is specifying cookies for another domain. There are more details about cookies that can be nice to have.
I saw questions like Is there an equivalent to the Apache HTTP Client in JavaScript? but the answer works and sets the cookie within a browser and not in a specific container.
Note: I looked into https://github.com/jed/cookies/blob/master/lib/cookies.js , it is the closer library that matches the question right now. The most important issue against it is that there is not a getter for a domain: imagine you want to return all cookies for the yahoo.com domain, this logic is not part of the library and it is one of the most important features for a cookie library to decide which cookies to send in an HTTP request.