Make WordPress Core

Opened 2 years ago

Closed 7 weeks ago

#55440 closed enhancement (duplicate)

Introduce a wrapper fro setcookie()

Reported by: chouby's profile Chouby Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:

Description

Recent browsers expect the parameter samesite to be set. A new parameter sameparty is on its way too.

The old (PHP < 7.3) setcookie() signature doesn't accept these new parameters. It's however possible to set them with a hack.

I propose to introduce a new wp_set_cookie() function to support all versions of PHP. I also propose to introduce a filter in this function. This should help for #37000.

Attachments (1)

55440.patch (2.4 KB) - added by Chouby 2 years ago.

Download all attachments as: .zip

Change History (4)

@Chouby
2 years ago

#1 @Chouby
2 years ago

  • Keywords has-patch added

The first patch is proposed for feedback on the function itself. It doesn't include the replacement of the current calls to setcookie() by wp_set_cookie().

This ticket was mentioned in Slack in #core by sebastienserre. View the logs.


7 weeks ago

#3 @swissspidy
7 weeks ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

The proposed patch is pretty similar to the ones from #37000, and ultimately both tickets are trying to address the same issue.

Note: See TracTickets for help on using tickets.