Docly Developers
Function API only Updated 01 Nov 2026

logOut()

Ends the Docly session the calling user signed in to this site with, and clears the session cookie. Only this site is signed out: the user stays signed in to other Docly sites and to the Docly app. Whether the user is still signed in to Docly itself depends on the choice made on the sign-in page ("Stay signed in to Docly", off by default) - left off, logOut() signs the user out completely. Typically invoked from an API endpoint (e.g. #/API/LogOut.js) that returns the result to the browser. If your app issues its own JWT cookie with writeJwt(), use deleteJwt() instead to remove that cookie.

Parameters

This function takes no parameters.

Returns

Always true.

Example

Mixed HTML (or any text file) with inline JavaScript between hash signs.
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Log out!</title>
</head>
<body style="font-size:2em; text-align:center; font-family: arial; margin-top:2em;">
    <div id="message">You are now logging out! ⏳</div>
    <a style="display:none" id="link1" href="/">Log in again</a>
    <script>
        // Fetch "API/LogOut" and then display "You are now logged out!"
        fetch('API/LogOut')
            .then(response => response.json())
            .then(data => {
                document.getElementById('message').innerText = 'Thank you, you are now logged out!';
                document.getElementById("link1").style.display = "";
            })
            .catch(error => {
                // Display error message in GUI
                document.getElementById('message').innerText = 'Error during logout: ' + error.message;
                console.error('Error:', error);
            });
    </script>
</body>
</html>