You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was playing with your cookies library, and I can't seem to retrieve cookies from store if they were set with a path ending with a slash. The store stores the cookies under the path as in Cookie.path, but MemoryCookieStore.findCookies looks for matching results of permutePath, which strips the trailing slash.
jar.store={"domain": {"/some/path/": Cookie}}// notice the trailing slash
while MemoryCookieStore.findCookies("http://domain/some/path/file") looks for
jar.store["domain"]["/some/path/file"]jar.store["domain"]["/some/path"]// no trailing slashjar.store["domain"]["/some"]jar.store["domain"]["/"]
instead of
jar.store["domain"]["/some/path/"]// has trailing slash
So it returns an empty array.
I think CookieJar.setCookie or some other method should run Cookie.path = permutePath(Cookie.path).shift() on the cookie if it has a non-empty path set.
Anyway, nice module :)
Cheers,
Lukas
The text was updated successfully, but these errors were encountered:
Hi,
I was playing with your cookies library, and I can't seem to retrieve cookies from store if they were set with a path ending with a slash. The store stores the cookies under the path as in
Cookie.path
, butMemoryCookieStore.findCookies
looks for matching results ofpermutePath
, which strips the trailing slash.i.e.
produces something like
while
MemoryCookieStore.findCookies("http://domain/some/path/file")
looks forinstead of
So it returns an empty array.
I think
CookieJar.setCookie
or some other method should runCookie.path = permutePath(Cookie.path).shift()
on the cookie if it has a non-empty path set.Anyway, nice module :)
Cheers,
Lukas
The text was updated successfully, but these errors were encountered: