Skip to content
Sites Hackathon is live / Aug 29 - Sep 12
Back

Session deletion for 'current' fails on client-side

  • 0
  • Tools
  • Web
  • Cloud
Los Feliz
3 Sep, 2025, 19:48

I want to delete the user's current session via the client side. This is my full function:

TypeScript
export const deleteUserSession = async () => {
    try {
        const resRemoveSession = await account.deleteSession({
            sessionId: 'current'
        });

        return { success: resRemoveSession.message === '' }

    } catch (error) {
        console.error('Error removing session:', error);
        return { success: false }
    }
}

This is the error I get: Failed to load resource: net::ERR_SSL_PROTOCOL_ERROR

TypeScript
    at _Client.<anonymous> (appwrite.js?v=b8449cf1:509:30)
    at Generator.next (<anonymous>)
    at appwrite.js?v=b8449cf1:28:67
    at new Promise (<anonymous>)
    at __awaiter (appwrite.js?v=b8449cf1:10:10)
    at _Client.call (appwrite.js?v=b8449cf1:506:12)
    at Account.deleteSession (appwrite.js?v=b8449cf1:1603:24)
    at deleteUserSession

This is what I want: https://appwrite.io/docs/references/cloud/client-web/account#deleteSession

TL;DR
Developers are facing an issue with deleting the user's current session on the client-side using the Appwrite SDK. The error seems to be related to a network issue rather than an Appwrite exception. To troubleshoot, they should check if the SDK version is compatible with the Appwrite Cloud version. They are using `"appwrite": "^19.0.0",` as a dependency. The function to delete the user's session is provided, but it results in a network error with the message `Failed to load resource: net::ERR_SSL_PROTOCOL_ERROR`. The desired outcome is to remove the user's current session via the client
Los Feliz
3 Sep, 2025, 19:49

@Kenny 👆

Kenny
3 Sep, 2025, 19:53

What version of appwrite sdk? Coud or self hosted?

Los Feliz
3 Sep, 2025, 19:54

Dependency: "appwrite": "^19.0.0",

Los Feliz
3 Sep, 2025, 19:54

Cloud Version 1.8.0

Kenny
3 Sep, 2025, 19:59

hmm that doesn't seem like an issue with appwrite, but maybe with the sdk itself? If it were appwrite you'd be catching an appwrite exception.

Did you recently upgrade the version? What were you on previously?

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