Open firecrauter opened 3 days ago
Although I have set in session.setCookie the URL without path (just the domain, as specified in the tough-cookie documentation).
if (session) {
const urlWithoutPath = new URL(request.url);
urlWithoutPath.pathname = '/';
const targetUrl = urlWithoutPath.toString();
const cookieString = 'adlt=1;';
session.setCookie(cookieString, targetUrl);
}
on https://github.com/apify/crawlee/blob/99aa278f45141ad99f88abd7845584e0e7b60a87/packages/core/src/cookie_utils.ts#L134 the full URL is passed, as seen in the image:
If I modify these lines with this, it fixes the issue:
const urlWithoutPath = new URL(url);
urlWithoutPath.pathname = '/'; // Reset the path to just "/"
return jar.getCookieStringSync(urlWithoutPath.toString());
as far as I understand so far, when using CookieJar, the URL's domain without the path should be passed.
Which package is this bug report for? If unsure which one to select, leave blank
None
Issue description
output:
Code sample
Package version
3.11.4, 3.11.5
Node.js version
22.6.0
Operating system
Windows 11, and Ubuntu 24.04
Apify platform
I have tested this on the
next
releaseNo response
Other context
No response