uBlockOrigin/uBlock-issues

Cookie Domain Problem with Scriptlets

JoviDong opened this issue · 3 comments

Prerequisites

  • I verified that this is not a filter list issue. Report any issues with filter lists or broken website functionality in the uAssets issue tracker.
  • This is NOT a YouTube, Facebook or Twitch report. These sites MUST be reported by clicking their respective links.
  • This is not a support issue or a question. For support, questions, or help, visit /r/uBlockOrigin.
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue.
  • The issue is not present after disabling uBO in the browser.
  • I checked the documentation to understand that the issue I am reporting is not normal behavior.

I tried to reproduce the issue when...

  • uBO is the only extension.
  • uBO uses default lists and settings.
  • using a new, unmodified browser profile.

Description

I have been attempting to use scriptlets in uBlock Origin to modify cookies on the website expedia.com. Specifically, I have tried using both set-cookie and trusted-set-cookie scriptlets to set a cookie with the domain ".expedia.com" in order to make it accessible across subdomains. However, I have encountered an issue where the domain of the cookie is being set to "www.expedia.com" instead of ".expedia.com".

A specific URL where the issue occurs.

https://www.expedia.com/

Steps to Reproduce

1.Navigate to the website expedia.com.

2.Use the following scriptlet syntax in uBlock Origin to set a cookie:
expedia.com##+js(set-cookie, id, 999) or
expedia.com##+js(trusted-set-cookie, id, 999)

3.Verify the domain of the set cookie using browser developer tools.

0

Expected behavior

I expect the cookie to be set with the domain ".expedia.com", allowing it to be accessible across subdomains of expedia.com.

Actual behavior

The domain of the cookie is being set to "www.expedia.com" instead of ".expedia.com", which restricts its accessibility to the specific subdomain.

uBO version

uBlock Origin development build 1.56.1rc5

Browser name and version

Google Chrome Version 123.0.6312.86

Operating System and version

Windows 11

Use

expedia.com##+js(set-cookie, id, 999, , domain, expedia.com)

or

 expedia.com##+js(trusted-set-cookie, id, 999, , , domain, expedia.com)

JoviDong : I expect the cookie to be set with the domain ".expedia.com", allowing it to be accessible across subdomains of expedia.com.

Duplicate of:

Already possible with additional domain parameter as explained in the above comment and in the above the link,
just that Wiki / documentation hasn't been updated yet: https://github.com/uBlockOrigin/uBlock-issues/wiki/Resources-Library#trusted-set-cookiejs-
it can be added to the "Wiki" section of the TO-DO tasks list : Issues/Tasks list #3151


stephenhawk8054 : Use set-cookie or trusted-set-cookie

Only trusted-set-cookie works with domain.

documentation hasn't been updated yet

I just updated it.