ampproject / amphtml

The AMP web component framework.
https://amp.dev
Apache License 2.0
14.89k stars 3.89k forks source link

amp-list does not send cookies on iPhone 5/se #36168

Open 06romix opened 3 years ago

06romix commented 3 years ago

Description

When using iPhone 5/se amp-list does not send cookies, and there is no possibility to show customer-related data.

Reproduction Steps

You need a PHP server with valid SSL to make test

  1. Create an amp page index.html with the following content

    <!doctype html>
    <html ⚡ lang="en">
    <head>
    <meta charset="utf-8">
    <title>amp-list</title>
    <script async src="https://cdn.ampproject.org/v0.js"></script>
    <script async custom-element="amp-list" src="https://cdn.ampproject.org/v0/amp-list-0.1.js"></script>
    <script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.2.js"></script>
    <meta name="viewport" content="width=device-width">
    <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
    </head>
    <body>
    <div>
    Cookie value: <amp-list id="myAmpList" layout="fixed-height" height="20" src="test.php">
        <template type="amp-mustache">
             <span>{{cookieValue}}</span>
        </template>
    </amp-list>
    </div>
    </body>
    </html>
  2. Create amp-list endpoint test.php

<?php
echo json_encode(['items' => [['cookieValue' => $_COOKIE['test'] ?? 'not found']]]);
  1. Create setcookie.php file to set cookie and checking if cookie is set correctly

    <?php
    echo '<pre>';
    print_r($_COOKIE);
    setcookie('test', '123111111123');
  2. Get your desktop

  3. Go to setcookie.php to set cookie

  4. Refresh the page to see whether the cookie is set

  5. Go to index.html and wait when amp-list loaded

  6. See 123111111123 value

  7. Do 5-7 steps on iPhone 5/se or use https://app.lambdatest.com/console/realtime

  8. See 'not found' instead of 123111111123 on index.html page

Relevant Logs

No response

Browser(s) Affected

No response

OS(s) Affected

No response

Device(s) Affected

iPhone 5/se

AMP Version Affected

No response

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.