[Solved] logining out and logining in with a different user logs me back as first user
- 0
- Accounts
- Flutter

In the final client = Appwrite()..setEndpoint()..setProject()..persistSession=false;

I'm gonna try that

Oh nvm that variable doesn't exist but I'm gonna try ```import 'package:flutter/services.dart' show rootBundle; import 'package:localstorage/localstorage.dart';
// Create an instance of LocalStorage final LocalStorage storage = LocalStorage('my_app');
// Function to clear the stored session data Future<void> clearSessionData() async { await storage.clear(); }
// Call clearSessionData after deleting the session await Account.deleteSession(sessionId); await clearSessionData();```

Then I'm gonna try reloading the page with ```import 'package:flutter_inappwebview/flutter_inappwebview.dart';
// Function to reload the web page Future<void> reloadWebPage() async { await InAppWebViewController?.instance?.reload(); }
// Call reloadWebPage after clearing the session data await clearSessionData(); await reloadWebPage();```

Then login with user B and it logs me in as user A.
So. what makes you say this?

I checked the code for the SDK and confirmed we handle all of this already so you shouldn't have to do any of this.

Nevermund inappwebview isn't supported for web

Oh wow

Yeah it's probably something I'm doing wrong

It does tell me Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.

perhaps you have something saved in your application state

That could be it too

right. once you delete your session. the local storage value should be cleared

Just making sure it's something weird in doing

Can you explain that more or show me

chrome dev tools > Application > Local Storage

Ahh okay

There's no way to force that?


Gotcha

How can I get the current sessionId is it the same as the uid


Okay will do thanks

I think I found the problem. It's the way I'm handling authentication I tried doing it a different way but I found a good way that should work. Thanks alot @Steven

[Solved] logining out and logining in with a different user logs me back as first user
Recommended threads
- 503 Timeout when Updating or Upserting D...
Hey I鈥檓 running into an issue when trying to update or upsert a row in Appwrite. The request hangs for a while and then throws this error: ``` AppwriteException...
- Hola equipo de soporte,
Hola equipo de soporte, Estoy desarrollando una Function en Appwrite Cloud con Node.js 22 y el siguiente package.json: {聽聽"name":聽"upload-whitelist",聽聽"type"...
- Sites 30MB limit from GitHub
I鈥檓 deploying a site from github as Other type on the Hobby plan. It is actually a Flutter web app but it鈥檚 in a subdirectory with the root being an html landin...
