Skip to content

Fix wording and formatting inconsistencies in cookies.set documentation#43107

Merged
rebloor merged 7 commits intomdn:mainfrom
Iyeroo:anisha
Feb 24, 2026
Merged

Fix wording and formatting inconsistencies in cookies.set documentation#43107
rebloor merged 7 commits intomdn:mainfrom
Iyeroo:anisha

Conversation

@Iyeroo
Copy link
Contributor

@Iyeroo Iyeroo commented Feb 12, 2026

Description

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/set#expirationdate
The above link redirects to expirationdate of cookie the statement was grammatically incorrect it started with can include milliseconds' there was no pronoun prior to it making it sound subordinate.

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/set#httponly

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/set#secure

The above links followed true in <code> not following same for false making it inconsistent so I included false as well in <code> to maintain the consistency.

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/set#name

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/set#value

The meaning to the line in above links (if omitted, this is empty by default) was unclear to make it sound the clear I replaced it with the below line:

If omitted, the value defaults to an empty string ("").

Motivation

I like to read documentation that carry clarity and easy to understand so this made me make these changes which get rid of ambiguity readers faced for while.

Additional details

Related issues and pull requests

Fixes #42988

@Iyeroo Iyeroo requested a review from a team as a code owner February 12, 2026 17:57
@Iyeroo Iyeroo requested review from Rob--W and removed request for a team February 12, 2026 17:57
@github-actions github-actions bot added Content:WebExt WebExtensions docs size/s [PR only] 6-50 LoC changed labels Feb 12, 2026
- : A `string` representing the domain the cookie belongs to (e.g., "www.google.com" or "example.com").
- `expirationDate` {{optional_inline}}
- : A `number` representing the expiration date of the cookie as the seconds after the UNIX epoch. Includes milliseconds in the fractional part. Not provided for session cookies.
- : A `number` representing the expiration date of the cookie as the seconds after the UNIX epoch.It can include milliseconds in the fractional part.If omitted, the cookie becomes a session cookie.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last

Suggested change
- : A `number` representing the expiration date of the cookie as the seconds after the UNIX epoch.It can include milliseconds in the fractional part.If omitted, the cookie becomes a session cookie.
- : A `number` representing the expiration date of the cookie as the seconds after the UNIX epoch. It can include milliseconds in the fractional part. Not provided for session cookies.

This type describes the return value of various cookie APIs. The last fragment was copied from the cookies.set description, where "becomes" makes sense because the method creates or updates a cookie. When a cookie is read, "becomes" feels odd, because the cookie does not become anything, its state is returned as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thankyou for the feedback I will revise it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Iyeroo, please also refer to the feedback you received from me on Object #43110.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Maintainers,
I referred to your feedback and understood that set method is responsible to make a cookie session cookie not cookies.cookie() object and have made changes with respect to the same reference.Waiting for review

- : A `string` representing the domain the cookie belongs to (e.g., "www.google.com" or "example.com").
- `expirationDate` {{optional_inline}}
- : A `number` representing the expiration date of the cookie as the seconds after the UNIX epoch. Includes milliseconds in the fractional part. Not provided for session cookies.
- : A `number` representing the expiration date of the cookie as the seconds after the UNIX epoch.Can include milliseconds in the fractional part.Not provided for session cookies.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- : A `number` representing the expiration date of the cookie as the seconds after the UNIX epoch.Can include milliseconds in the fractional part.Not provided for session cookies.
- : A `number` representing the expiration date of the cookie as the seconds after the UNIX epoch. Includes milliseconds in the fractional part. Not provided for session cookies.

The fractional part always includes the milliseconds value from the expiration date.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understood the fact and revised it waiting for review.

- : A `boolean`, `true` if the cookie is marked as HttpOnly (i.e., the cookie is inaccessible to client-side scripts), or false otherwise.
- `name`
- : A `string` representing the name of the cookie.
- : A `string` representing the name of the cookie.If omitted, this is empty by default.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- : A `string` representing the name of the cookie.If omitted, this is empty by default.
- : A `string` representing the name of the cookie.

As this is the return value of the cookie name can't be "omitted".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understood that whatever is returned as an object cannot be omitted and made the changes.

- : A `boolean`, `true` if the cookie is a host-only cookie (i.e., the request's host must exactly match the domain of the cookie), or `false` otherwise.
- `httpOnly`
- : A `boolean`, `true` if the cookie is marked as HttpOnly (i.e., the cookie is inaccessible to client-side scripts), or `false` otherwise.
- : A `boolean`, `true` if the cookie is marked as HttpOnly (i.e., the cookie is inaccessible to client-side scripts), or false otherwise.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- : A `boolean`, `true` if the cookie is marked as HttpOnly (i.e., the cookie is inaccessible to client-side scripts), or false otherwise.
- : A `boolean`, `true` if the cookie is marked as HttpOnly (i.e., the cookie is inaccessible to client-side scripts), or `false` otherwise.

As true and false are returned values they should both be in code format.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have included both in code format.Waiting for review.

- : A `string` representing the path of the cookie.
- `secure`
- : A `boolean`, `true` if the cookie is marked as secure (i.e., its scope is limited to secure channels, typically HTTPS), or `false` otherwise.
- : A `boolean`, `true` if the cookie is marked as secure (i.e., its scope is limited to secure channels, typically HTTPS), or false otherwise.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- : A `boolean`, `true` if the cookie is marked as secure (i.e., its scope is limited to secure channels, typically HTTPS), or false otherwise.
- : A `boolean`, `true` if the cookie is marked as secure (i.e., its scope is limited to secure channels, typically HTTPS), or `false` otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made suggested changes.

- : A `string` representing the ID of the cookie store containing this cookie, as provided by {{WebExtAPIRef("cookies.getAllCookieStores()")}}.
- `value`
- : A `string` representing the value of the cookie.
- : A `string` representing the value of the cookie. If omitted, this is empty by default.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- : A `string` representing the value of the cookie. If omitted, this is empty by default.
- : A `string` representing the value of the cookie.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I revised it.

- : A `string` representing the domain of the cookie. If omitted, the cookie becomes a host-only cookie.
- `expirationDate` {{optional_inline}}
- : A `number` that represents the expiration date of the cookie as the seconds after the UNIX epoch. Can include milliseconds in the fractional part. If omitted, the cookie becomes a session cookie.
- : A `number` that represents the expiration date of the cookie as the seconds after the UNIX epoch.It can include milliseconds in the fractional part.If omitted, the cookie becomes a session cookie.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- : A `number` that represents the expiration date of the cookie as the seconds after the UNIX epoch.It can include milliseconds in the fractional part.If omitted, the cookie becomes a session cookie.
- : A `number` that represents the expiration date of the cookie as the seconds after the UNIX epoch. It can include milliseconds in the fractional part. If omitted, the cookie becomes a session cookie.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has been made.

- : A `boolean` that specifies whether the cookie is marked as HttpOnly (`true`), or not (`false`). If omitted, it defaults to `false`.
- `name` {{optional_inline}}
- : A `string` representing the name of the cookie. If omitted, this is empty by default.
- : A `string` representing the name of the cookie.If omitted, the name defaults to an empty string (`""`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- : A `string` representing the name of the cookie.If omitted, the name defaults to an empty string (`""`).
- : A `string` representing the name of the cookie. If omitted, the name defaults to an empty string (`""`).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello maintainers,
I have made all changes suggested.waiting for review.

@rebloor rebloor dismissed their stale review February 24, 2026 22:58

The necessary changes have now been made

@github-actions
Copy link
Contributor

Preview URLs (1 page)

Copy link
Contributor

@rebloor rebloor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @Iyeroo

@rebloor rebloor merged commit 32823bb into mdn:main Feb 24, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebExt WebExtensions docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cookies.set(): minor improvements

3 participants