what is best strategy to make user keep connected while refresh?
p
polite-oil-10264
09/23/2025, 10:44 PM
What exactly is the scenario you want? Should the user rejoin automatically when they refresh, or should the track remain as if they're still in the room even after they leave? If you want them to join directly after a refresh, you can simply trigger a useEffect that generates a new token for them to join the same session.
a
average-knife-77348
09/24/2025, 5:41 AM
yes that is what i want, user rejoins automatically when they refresh.
but in the node.js i can't do that because of "source already set" error. so was curious of if keep room alive->rejoining to room is right flow.
sounds like it is the right thing to do
p
polite-oil-10264
09/24/2025, 8:50 PM
In my case, I was doing this: when a user joins, their deviceId, name, and audioId are saved into cookies, along with the sessionName. Then, when the user refreshes the page and those cookie values exist, they are automatically set into userChoice, and the token API is triggered to make the user join again the same session