Convex-Dev / convex-web

https://convex.world
16 stars 18 forks source link

Sessions not persisting? #200

Closed mikera closed 3 years ago

mikera commented 3 years ago

If I close my Chrome tabs (on windows) but then open conex.world again, I appear to lose all my previous accounts and session data.

It it possible to retain these? e.g. with a session cookie?

pedrorgirardi commented 3 years ago

This is strange @mikera . The session has always been persisted, and I just tried on Firefox and Safari - I closed the browser and opened it again, and I can still access my accounts (session).

mikera commented 3 years ago

Hmm maybe it was Chrome being too aggressive about blocking cookies?

pedrorgirardi commented 3 years ago

I can reproduce on macOS with Chrome.

There's a setting to clear cookies when you close all windows, but mine is disabled, and Google Chrome still clears the cookies when I close the window. It's a bit puzzling.

Screen Shot 2021-09-18 at 6 43 37 PM
mikera commented 3 years ago

Will become less urgent once we have the facility to restore an account with an explicit keypair

pedrorgirardi commented 3 years ago

If you save your wallet key, you can restore your wallet. It doesn't fix the problem, but at least you don't lose access to your wallet.

pedrorgirardi commented 3 years ago
Screen Shot 2021-09-20 at 6 53 20 PM

We are using session cookies so you need to set Chrome to restore your previous sessions on startup:

Screen Shot 2021-09-20 at 6 13 42 PM

Can you see if this works for you @mikera ?

mikera commented 3 years ago

Looking at the ring-session cookie in Chrome I see:

Expires
When the browsing session ends

Shouldn't that be some future time?

pedrorgirardi commented 3 years ago

We can explicitly set the expiration for the cookie, but we need to set it to a distant future since we don't have sign-in, and once the cookie expires, the user will lose their wallet.

Setting the expiration is explicit, and we don't depend on the browser's session behavior, so it seems a better idea @mikera .