Making a mercure /hub dispaching Updates with symfony 4.4 works fine until I dont try using credentials with mercureAuthorization cookie.
As soon as I add {withCredentials: true} in EventSource, firefox kicks out event source request connection with "CORS missing" (whereas chrome doesn't)
'same origin' policy don't allow consulting 'http://localhost:3000/.well-known/mercure ... ' Reason: CORS header 'Access-Control-Allow-Origin' missing
Plus, I'm supposed to get the mercureAuthorization cookie passed from my page request to the event source request, but it isn't.
Here is my homePage cookie :
Set-Cookie: mercureAuthorization=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJtZXJjdXJlIjp7InN1YnNjcmliZSI6WyJodHRwOlwvXC9ub3RpZnkuY29tXC9wYXJhbmdvblwvdGVhbSJdfX0.e5YOGcOx-s-8nn2lbseqcVlk18dVEvgZIoKrDCEureA; path=/.well-known/mercure; httponly; samesite=strict;
My event source Request
Request URL: http://localhost:3000/.well-known/mercure?topic=http://notify.com/
No Set-Coockie indside.
EDIT: I finally manage to fix it by working on the same domain ! So know I run the mercure server with:
--adress:'www.mydomain.test:3000/.well-known/mercure ... '
Posting from
'www.mydomain.test/' for exemple
Set-Cookie:
'return new Cookie('mercureAuthorization', $token,
(exp) 0,
(path) '/.well-known/mercure',
(domain) null,
(secure) false,
(httponly) true,
(raw) false,
(same-site) 'Strict'
);'