what is best strategy to make user keep connected ...
# sdk-web
a
what is best strategy to make user keep connected while refresh?
p
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
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
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
a
ah so you are saying that if we want to rejoin and not to see this https://livekit-users.slack.com/archives/C088ZNU7QQ5/p1757665097813729 i should specify session, not just room