tlaverdure / laravel-echo-server

Socket.io server for Laravel Echo
MIT License
2.64k stars 509 forks source link

socketio.cookie attribute in laravel-echo-server.json is not taken into account and is not displayed correctly in browser #531

Closed micisse closed 1 year ago

micisse commented 4 years ago

Describe the bug

A future release of Chrome will only deliver cookies with cross-site requests if they are set with SameSite=None and Secure. So I use socketio.cookie attribute in my laravel-echo-server.json:

"socketio": { "cookie": { "sameSite": "none", "secure": "true" } }

But in my network devtools console, this attribute is not taken into account and is not displayed correctly, the output is as follows:

Deprec2

Has anyone encountered the same problem?

mwleinad commented 1 year ago

hello there, @micisse were you able to make cookies work? my websocket and channels are working but I can't see any of the cookies I wonder if I need to use https protocol or what, but none of the config on socketio is even working (I also wonder if the version I'm using is buggy, I'm on 1.6.1)

micisse commented 1 year ago

Hello @mwleinad, I had even forgotten that I had opened this issue. I have upgraded to the latest version 1.6.2. try this:

"protocol": "https", "socketio": { "cookie": { "name": "testt", "path": "/", "sameSite": "none", "secure": true, "httpOnly": false, "domain": ".domain.com" } }, "sslCertPath": "cert path", "sslKeyPath": "key path" and https://github.com/tlaverdure/laravel-echo-server#cross-domain-access-to-api

Set "name": "cookieName" to avoid undefined=GTXuA48z65ez8jHgAAAB;

sio

I also remind that the server used here 'authHost' in laravel-echo-server.json is under https, I don't use http. I hope this will help you ! I close 😉