Persist room session even if browser is refreshed

9 Mar 2020, 16:46

Whenever the page is refreshed in the client browser, the room session is destroyed.

Is there a way to persist the session even if the browser client is refreshed?

Thanks.

9 Mar 2020, 16:49

Hi @codestitch, to allow the client to reconnect to the room he was previously connected with, you'd need to use allowReconnection(): https://docs.colyseus.io/server/room/#allowreconnection-client-seconds

9 Mar 2020, 17:13

Oh, cool!!! Thanks for the quick response @endel .

A million appreciation.

9 Mar 2020, 18:40

Hi @endel , @codestitch , side-note, beside the allowReconnection I though some additional will be required to make it work, like express-session or so? https://www.npmjs.com/package/express-session
Here is the related topic: https://discuss.colyseus.io/topic/139/persistent-sessions/4

9 Mar 2020, 19:02
This post is deleted!