Clear Session Storage question
I 'm building a web app that requires login authentication through Xano . When authorization succeeds , I store the token via "Set Session Cookies " . This way , when I load the app , I can check if the user is authorized by calling an auth API to Xano . There 's no need to pass a token manually , as the API call retrieves the token from the saved session . It works great ! Now , I have a menu item "Log Out " . What I do here is clear the session storage . I expected that , the next time I call the Auth API to Xano , it would fail because there would be no token in the session storage . However , that 's not the case . Even after clearing the session storage , authorization to Xano still works . Is this the correct way to "clear " the saved token ? This is the API call for the authorization : Hi Patrick ! The auth information is stored in a cookie . Cookies are not part of the session storage . So if you clear the session storage , you won 't loose the auth info . To be honest , I never did that in Toddle , because our backend has a "logout " endpoint that invalidates the session . As far as I know , Xano cannot do that . So I would set the session cookie to Null . That should remove the cookie Well , it clears the session storage 😅 . There are three main types of storage you can access in Toddle (and JS ) : Cookies (permanent with optional aging , for tokens and identifiers mainly ) , Session Storage (volatile , is cleared when the browser is closed or refreshed ) , and Local Storage (permanent ) . Local storage is useful , for example , for storing local config (light /dark mode , language , preferred layout . . . ) . Session storage can be used for information that is relevant for the current session but does not need to be stored permanently (e .g . , the visited screens , recently opened stuff . . . ) . When you store info in session storage ( "Save to Session Storage " ) , this data can be cleared with the "Clear Session Storage " command . Can also manually clear tokens and /or set expiration to 0 So it effectively logs a user out


.jpeg/public)