Bug 230928 - WebExtension cookie storage expiration date is off by 30 years
Summary: WebExtension cookie storage expiration date is off by 30 years
Status: RESOLVED MOVED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: Other
Hardware: iPhone / iPad macOS 11
: P2 Critical
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-28 18:13 PDT by Mikhail Labanov
Modified: 2022-06-30 10:58 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Labanov 2021-09-28 18:13:57 PDT
Steps to reproduce

1. Create a web extension for iOS 15
2. In context of WebExtension's background page set a cookie for a domain:
window.browser.cookies.set({
   name: 'mycookie',
   value: '123',
   url: "https://www.example.com",
   domain: ".example.com",
   expirationDate: Date.now()/1000 + 60*60
})

Expected outcome:
A cookie "mycookie" is set with expiration date of now + 1 hour for the example.com domain

Real outcome:
A cookie with expiration date exactly 30 years in the future + 1 hour is created
(year 2052 as at the time of this bug is filed)
Comment 1 Mikhail Labanov 2021-09-28 18:43:15 PDT
The same is true for Desktop Safari WebExtension as well
Comment 2 Radar WebKit Bug Importer 2021-10-03 19:50:11 PDT
<rdar://problem/83820804>
Comment 3 Brent Fulgham 2022-06-30 10:58:51 PDT
The fix for this issue needs to be made outside of the WebKit project, therefore marking as "RESOLVED | MOVED".

We believe this issue is fixed in:
iOS 16.0 Beta 1 (and newer)
macOS Ventura Beta 1 (and newer)