websocket-manager
websocket-manager copied to clipboard
Return the same id to client on reload
Is it possible to get the same id to the client even when the user reloads the web page? I would like to send notifications even though the user has navigated away from the initial page.
There are several ways to accomplish this. FIrst of all, you need to keep some information about a user (id in a cookie for example). Then, keep a map of user ids and connection ids on the server.
Then, when you send a message to a connection id, send it to all connection ids associated to the user id.
Ok, I see. Thanks!