Skip to content

IResponse: add missing $sameSite parameter to setCookie()#247

Open
jelen07 wants to merge 13 commits into
nette:v3.3from
jelen07:fix/iresponse-setcookie-samesite-v3.3
Open

IResponse: add missing $sameSite parameter to setCookie()#247
jelen07 wants to merge 13 commits into
nette:v3.3from
jelen07:fix/iresponse-setcookie-samesite-v3.3

Conversation

@jelen07
Copy link
Copy Markdown

@jelen07 jelen07 commented Mar 12, 2026

Summary

  • The concrete Response::setCookie() already accepts ?string $sameSite as the 8th parameter, but the IResponse interface is missing it
  • This makes it impossible to set the SameSite cookie attribute when type-hinting against the interface without suppressing static analysis errors (e.g. PHPStan reports argument.unknown)
  • The fix on master (4.0) already includes this parameter — this backports it to v3.3

Diff

Single line addition: ?string $sameSite = null as the last parameter of IResponse::setCookie()

This is backwards-compatible since the parameter is optional with a null default.

dg and others added 13 commits February 26, 2026 06:09
- removed slow getRemoteHost() reverse DNS lookups assertions
- The concrete Response::setCookie() already accepts ?string $sameSite as the 8th parameter, but the IResponse interface is missing it. This makes it impossible to set the SameSite attribute when working with the interface without suppressing static analysis errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dg dg force-pushed the v3.3 branch 4 times, most recently from 264bb23 to d92cb97 Compare May 26, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants