ingenerator / php-utils

Simple, standalone utility classes for PHP applications
BSD 3-Clause "New" or "Revised" License
1 stars 2 forks source link

Require PHP7.4 and use new setcookie() signature #28

Closed craig410 closed 4 years ago

craig410 commented 4 years ago

@acoulton, can you have a look over this, something doesn't feel right but it's perhaps just how its got to be tested without actually setting cookies.

I've had to add $samesite as an argument to our internal set_cookie() method to assert against it in the tests. We only actually add the option 'samesite' to \setcookie() if it's not NULL which should all follow the current behaviour

The value of the samesite element should be either None, Lax or Strict. If any of the allowed options are not given, their default values are the same as the default values of the explicit parameters. If the samesite element is omitted, no SameSite cookie attribute is set. from https://www.php.net/manual/en/function.setcookie.php