News for hackers. Stuff that matters.
Re:Server-Sent Events: an alternative to WebSockets by bullen on Saturday February 12, 2022 @10:35AM (#30313539)
Aha, well why do you need to send a header when you can just put the data on the GET URL like so "blabla?cookie=erWR32" for example?

In my example I use this code:

        var source = new EventSource('pull?name=one');
        source.onmessage = function (event) {
           document.getElementById('events').innerHTML += event.data;
        };
Re:Server-Sent Events: an alternative to WebSockets by tytho on Saturday February 12, 2022 @10:52AM (#30313679)
I think that works great! The complaint I’ve heard is that you may need to support multiple ways to authenticate opening up more attack surface.
Re:Server-Sent Events: an alternative to WebSockets by kreetx on Saturday February 12, 2022 @10:53AM (#30313682)
What if you use http-only cookies?
Re:Server-Sent Events: an alternative to WebSockets by tytho on Saturday February 12, 2022 @10:56AM (#30313704)
You can pass a ‘withCredentials’ option.