Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 8432 cookie php73 #8436

Merged
merged 3 commits into from Feb 13, 2020

Conversation

lukassykora
Copy link
Contributor

@lukassykora lukassykora commented Feb 13, 2020

Please be sure you are submitting this against the staging branch.

Closes #8432

Q A
Bug fix?
New feature? Support for PHP 7.3
Automated tests included? Tested by CookieHelperTest
Related user documentation PR URL
Related developer documentation PR URL
Issues addressed (#s or URLs) #8432
BC breaks?
Deprecations?

Description:

PHP 7.3 handles samesite in different way in setcookie function.

Steps to reproduce the bug:

  1. Switch to PHP 7.3
  2. Run test and you should get warnings.

Steps to test this PR:

  1. No warning for PHP 7.3
  2. Cookies are sent and have secure and samesitee=None

List deprecations along with the new alternative:

List backwards compatibility breaks:

@dennisameling dennisameling added this to the 2.16.0 milestone Feb 13, 2020
Copy link
Member

@dennisameling dennisameling left a comment

Choose a reason for hiding this comment

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

Tested locally with PHP 7.2 and 7.3 and works in both cases. Merging into staging now, providing test steps soon in a separate comment.

@dennisameling dennisameling merged commit 752aff9 into mautic:staging Feb 13, 2020
@dennisameling dennisameling added this to Merged in Mautic 2 via automation Feb 13, 2020
@dennisameling
Copy link
Member

dennisameling commented Feb 13, 2020

Steps to test:

<!doctype html>
<html>
    <head>
        <script>
            (function(w,d,t,u,n,a,m){w['MauticTrackingObject']=n;
                w[n]=w[n]||function(){(w[n].q=w[n].q||[]).push(arguments)},a=d.createElement(t),
                m=d.getElementsByTagName(t)[0];a.async=1;a.src=u;m.parentNode.insertBefore(a,m)
            })(window,document,'script','https://mautic.local/mtc.js','mt');
        
            mt('send', 'pageview');
        </script>
    </head>
</html>
  • Open your browser console in Chrome (Developer Tools > Console)
  • Open your HTML file in Chrome (https://mydomain.local/myfile.html)

On an instance with Mautic 2.15.3, this results in the following console warning:

image

On an instance with the PR you just checked out, you should not get this warning message.

In my testing this worked with both PHP 7.2 and 7.3.

@mautibot
Copy link

mautibot commented Apr 3, 2020

This pull request has been mentioned on Mautic Community Forums. There might be relevant details there:

https://forum.mautic.org/t/setting-cookie-to-samesite-none-not-working/13773/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Mautic 2
  
Merged
Development

Successfully merging this pull request may close these issues.

Samesite cookie fix not working in PHP 7.3 and higher
3 participants