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

[8.x] Fix assertCookieExpired and assertCookieNotExpired checks for session cookies #35637

Merged
merged 1 commit into from
Dec 17, 2020

Conversation

inxilpro
Copy link
Contributor

This PR brings the backwards-compatible bugfixes from #35611 into the 8.x branch.

Currently both assertCookieExpired() and assertCookieNotExpired() do not handle session cookies (where they don't have an expires timestamp, and thus will be removed at the end of the browser session).

For example:

$response = TestResponse::fromBaseResponse(
  (new Response())->withCookie(new Cookie('cookie-name', 'cookie-value'))
);

$response->assertCookieExpired('cookie-name'); // Will pass
$response->assertCookieNotExpired('cookie-name'); // Will fail

I've also pulled in the other backwards-compatible cookie tests into this PR so they exist in the 8.x branch as well.

@inxilpro
Copy link
Contributor Author

This is triggering the same PHP8 error as #35636 — I'll dig into it a little later if it doesn't resolve on its own.

@taylorotwell taylorotwell merged commit 79b804e into laravel:8.x Dec 17, 2020
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