ampproject / ampproject/amphtml

GFP cookie expiration uses seconds instead of milliseconds

Open
#40,463 1 comment 0 reactions 0 assignees View on GitHub
Type: Bug
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

### Description

GFP cookie expiration times are set based on a value derived from an http response header from ad responses. The http header sets the expiration in seconds, but client code in AMP expects milliseconds. This results in expiration dates in the past, and hence no cookies are being set.

### Reproduction Steps

View any AMP page with an A4A ad. See the amp-ff-set-cookies header value and note the "expires" value. Observe that if this value is passed to `new Date(expires).toUTCString()` the date will be in 1970. Observe further that no cookie set in the browser. Multiplying this value by 1000 (converting to ms) makes the date correct.

### Relevant Logs

```shell

```

### Browser(s) Affected

_No response_

### OS(s) Affected

_No response_

### Device(s) Affected

_No response_

### AMP Version Affected

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.