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

[5.7] Reflash the session for the broadcasting auth call. #27647

Merged
merged 1 commit into from
Feb 25, 2019
Merged

[5.7] Reflash the session for the broadcasting auth call. #27647

merged 1 commit into from
Feb 25, 2019

Conversation

AbdelElrafa
Copy link
Contributor

When using session flash and broadcasting, the flashed message is being aged by the presence channel auth request. The BroadcastController needs the web middleware in order to authenticate the user, however while accessing the session middleware the flashed data is being aged out. Here is how the requests go:

  1. Home page <- Flash a "Hello" message. This will show on the current page, as it's in the flash new key.
  2. Home page presence request <- checks the user auth and has access to the flash old key. Ages the session and clears out the flashed message.
  3. Contact page <- Has no access to the "Hello" message since it was aged out by the "last" request which was the presence auth ajax request.

This is unexpected behavior, and since the auth request is not supposed to touch the session flash, we need to reflash it there to avoid the session flash being aged out one request too early.

I can't think of a reasonable way to write a test for this, so if someone can suggest something I'll be happy to write it.

@taylorotwell taylorotwell merged commit cd017b7 into laravel:5.7 Feb 25, 2019
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