deleteJwt Last updated: 01. May 2026

API only function

The deleteJwt function is responsible for removing the current (if any) JWT (JSON Web Token) secure cookie from the user's browser.

See also: writeJwt denyAccess logOut flagActivity getProfilePictureUrl Custom JWT login example

Parameters

This function takes no parameters

Returns

True if successfull.

Example

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
// Log a user out by removing their JWT cookie
docly.deleteJwt();


// Typical use in a logout API endpoint:
// #/API/logout.js
export default () => {
    docly.deleteJwt();
    return { success: true };
}


// Note: deleteJwt() removes a custom JWT cookie set by writeJwt().
// To log a user out of the built-in Docly session, use docly.logOut() instead.