metacom
metacom copied to clipboard
Lost session for same client
Describe the bug
One authorized user uses an application with multiple tabs/windows. Server can not emit messages to all opened connections. There is no session in a run-time for second (other) tab/window.
To Reproduce
Use latest example. Open 2 windows in chrome. Try to use chat functionality.
Expected behavior
Server sends messages for all active clients throw channels.
Screenshots
Logs:
During subscribe for both clients session 8 used.
14:39:43 W2 debug Rpc call subscribe
14:39:43 W2 debug Client-8 from a channel-8
14:39:43 W2 debug Session exist for client: 8
14:39:44 W2 debug Rpc call subscribe
14:39:44 W2 debug Client-21 from a channel-21
14:39:44 W2 debug Session exist for client: 8
Here is client21 with channel21 sends a message, but only client8 receive
14:40:59 W2 debug Rpc call send
14:40:59 W2 debug Client-21 from a channel-21
14:40:59 W2 debug Session exist for client: 8
14:40:59 W2 debug Emitting event from client: 8
14:40:59 W2 debug Emitting with channel-8 attached for client-8
Client8 with channel8. Channel21 ignored
14:41:27 W2 debug Rpc call send
14:41:27 W2 debug Client-8 from a channel-8
14:41:27 W2 debug Session exist for client: 8
14:41:27 W2 debug Emitting event from client: 8
14:41:27 W2 debug Emitting with channel-8 attached for client-8
Desktop (please complete the following information):
- OS: Linux 64-bit
- Node.js 18
##Additional context
Add any other context about the problem here.
Update: problem localized - COOKIE. we have cookies per domain and use cookies to store token - session identifier. There is no such problem with different browsers and incognito mode.