-
-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Hi,
I'm using two topics on my symfony-project:
/user/notification/{userid} -> Send notifications to user (flash messages, statusupdates)
/user/messenger/{userid} -> Messages from other users
Both (private) topics were created by diefferent symfony-services.
At the client-side I'm using different stimulus-controllers:
"eventEndpoint": mercure(notificationChannelName, { subscribe: notificationChannelName })
"eventEndpoint": mercure(messengerChannelName, { subscribe: messengerChannelName})
Both topics are working perfect.
But when I'm using both on the same page, I get this error:
An exception has been thrown during the rendering of a template ("The "mercureAuthorization" cookie for the "default hub" has already been set. You cannot set it two times during the same request.").
I have no idea how to fix this.
I think I can set the cookie by myself:
$authorization->setCookie($request, ['/user/notification/{userid}','/user/messenger/{userid}']);
But the mercure-twig-helper still tries to set the cookie. -> Error again.
What can I do?