Keep the user in the same room even after refreshing the page [closed]

So I was looking into building a real time application and started learning socketio. I built a simple chatapp where you can create rooms and join and chat. But when a user refreshes the page after joining a room, the user is removed from the room. Is there a way to fix it? Thank you!

https://roomchat.theyashwanthsai.repl.co/

Tried searching but couldn’t find anything helpful

  • 1

    There’s no way we can answer this without seeing the relevant code in order to debug it.

    – 

  • 1

    Is the user logged in user server-side login? Save their room with their login details. Otherwise save it in localstorage or similar.

    – 

Leave a Comment