Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deleteSession API removes browser's cookieFallback #1193

Closed
RedLeeder opened this issue May 25, 2021 · 3 comments · Fixed by #1206
Closed

deleteSession API removes browser's cookieFallback #1193

RedLeeder opened this issue May 25, 2021 · 3 comments · Fixed by #1206
Assignees
Labels
bug Something isn't working

Comments

@RedLeeder
Copy link

🐛 Bug Report

Using .account.deleteSession('[SESSION_ID]') with SESSION_ID that is not the current one results in the session with SESSION_ID being removed (expected behavior) but also somehow removes the browser's Local Storage cookieFallback value (which makes the browser think the current session is destroyed, even though the session is still alive on appwrite).

Have you spent some time to check if this issue has been raised before?

Yep.

To Reproduce

  1. Pass SessionID value (that is not the current one) to the following function
async function deleteSession(id) {
    try {
      await api.deleteSession(id);
      props.notify('Session Removed', 'success');
      await getSessions(); // Refreshes the session list (but gets the 401 response due to cookieFallback being empty)
    } catch (e) {
      setError("Error: " + e.toString().replace('AppwriteException: ', ''));
    }
  }
  1. Which calls the following API command
deleteSession: (id) => {
  return api.provider().account.deleteSession(id);
},

Expected behavior

Session with Session ID is destroyed.

Actual Behavior

Session with Session ID is destroyed (Good) and cookieFallback value is deleted (Bad)

Before API
image

After API
image

Your Environment

React/Nodejs Implementation
Self Hosted Appwrite installation via Docker

@RedLeeder RedLeeder added the bug Something isn't working label May 25, 2021
eldadfux added a commit that referenced this issue May 28, 2021
…ng-fallback-cookie

fixes deleteSession API removes browser's cookieFallback #1193
@RedLeeder
Copy link
Author

So looks like this fix will be implemented in a future version? Thanks for the prompt response/fix implementation!

@eldadfux eldadfux added the waiting for release Fixed or implemented and waiting for a new version to be released label Jun 2, 2021
@eldadfux
Copy link
Member

eldadfux commented Jun 2, 2021

I would keep this open until the release is actually out.

@eldadfux eldadfux reopened this Jun 2, 2021
@eldadfux
Copy link
Member

eldadfux commented Jul 7, 2021

This is now fixed and available as part of Appwrite 0.9:
https://dev.to/appwrite/announcing-appwrite-0-9-the-open-source-firebase-alternative-53ho 🥳 🎉

@eldadfux eldadfux closed this as completed Jul 7, 2021
@eldadfux eldadfux removed the waiting for release Fixed or implemented and waiting for a new version to be released label Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants