Back

[SOLVED] Appwrite is using LocalStorage for session -- Vue

  • 0
  • Web
ZachHandley
30 Jul, 2023, 04:04
TL;DR
Appwrite is using LocalStorage for session in a Vue app. The issue was fixed by changing it to a computed property. However, the solution doesn't work for the web SDK, so in Node.js, you need to use `.setSelfSigned`. There was also a problem with the code that caused the user to be logged out intermittently. It was discovered that the issue was related to using localStorage. The user also mentioned that refreshing the page also logs them out. It was found that when developing on localhost with a server in the cloud, cookies are rejected and localStorage is used instead, which resets every 15 minutes. The user
ZachHandley
30 Jul, 2023, 04:04

unless it just wants it without the subdomain?

Drake
30 Jul, 2023, 04:04

Did you read what I linked?

ZachHandley
30 Jul, 2023, 04:06

I see that, so because I'm developing on localhost and my server is in the cloud it's going to reject my cookies and force localStorage which seems to be resetting every 15 minutes?

Drake
30 Jul, 2023, 04:06

Yes except for that last part.

ZachHandley
30 Jul, 2023, 04:07

well it keeps logging me out

ZachHandley
30 Jul, 2023, 04:07

idk why

ZachHandley
30 Jul, 2023, 04:07

it just resets the state every now and then and I get logged out

ZachHandley
30 Jul, 2023, 04:07

if I refresh the page it logs me out too

ZachHandley
30 Jul, 2023, 04:08

my current auth

ZachHandley
30 Jul, 2023, 04:08
Drake
30 Jul, 2023, 04:08

Can you check localstorage to see what's in there?

ZachHandley
30 Jul, 2023, 04:08

I call initAuth in App

ZachHandley
30 Jul, 2023, 04:08

yeah trying to find it

ZachHandley
30 Jul, 2023, 04:09

in edge

ZachHandley
30 Jul, 2023, 04:10
ZachHandley
30 Jul, 2023, 04:10

localStorage

ZachHandley
30 Jul, 2023, 04:10

but it says I'm logged out <a:thinkRoll:585724848823599105>

Drake
30 Jul, 2023, 04:10

So there's a problem with your code

Drake
30 Jul, 2023, 04:13

Can you use the debugger to walk through and see if account.get() is called?

ZachHandley
30 Jul, 2023, 04:14

Yeah I'm modifying the auth state right now to use a computed

ZachHandley
30 Jul, 2023, 04:14

do I need to use .setSelfSigned in node?

Drake
30 Jul, 2023, 04:15

That doesn't exist on the web sdk. You need it for node if you have an appwrite instance with a self signed certificate

ZachHandley
30 Jul, 2023, 04:18

I think that fixed it by changing it to a computed

Drake
11 Dec, 2023, 15:11

[SOLVED] Appwrite is using LocalStorage for session -- Vue

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more