Problem/Motivation

From #3027835-4: [symfony 4] Argument 1 passed to Symfony\Component\HttpFoundation\Response::setCharset() must be of the type string, null given:

The default value of the "$secure" and "$samesite" arguments of "Symfony\Component\HttpFoundation\Cookie::__construct"'s constructor will respectively change from "false" to "null" and from "null" to "lax" in Symfony 5.0, you should define their values explicitly or use "Cookie::create()" instead.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy created an issue. See original summary.

Berdir’s picture

Note from slack discussion:

This is a symfony 4 deprecation, we might not be able to do anything about that if we want to remain compatible with Symfony 3 but would have to add that to the excluded deprecation message list instead.

catch’s picture

Status: Active » Needs review
FileSize
159.41 KB
1.81 KB

We can and we can't do something about this.

Symfony is using the deprecation to ensure everyone specifies the default values, this is in preparation for changing the defaults in Symfony 5.

I found two places in core where we can just explicitly set the default values, so that's fine.

But Behat\Mink\Driver\BrowserKitDriver also uses the same class with the same problem, so it'll need an upstream fix and/or us adding it to skipped deprecations until an upstream fix is available. Did not look at the latter problem yet but here's a quick patch for our code.

catch’s picture

No mink update yet that I could find, so I posted a PR: https://github.com/minkphp/MinkBrowserKitDriver/pull/130

The last submitted patch, 3: 3027910-combined.patch, failed testing. View results

catch’s picture

We don't seem to be getting hit by the Mink usage (unless I'm missing something in the test results) so #3 might be enough.

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

This looks fine for now and if the mink usage becomes an issue we can follow-up in yet-another issue.

larowlan’s picture

Status: Reviewed & tested by the community » Fixed

Committed ffad365 and pushed to 8.7.x. Thanks!

  • larowlan committed ffad365 on 8.7.x
    Issue #3027872 by catch: [symfony 4] The default value of the "$secure"...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.