> For the complete documentation index, see [llms.txt](https://docs.cotter.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cotter.app/getting-access-token/storing-and-removing-tokens.md).

# Storing and Removing Tokens

OAuth Tokens **should be stored securely in the client**.&#x20;

* **Mobile apps:** Use [Android Keystore](https://developer.android.com/training/articles/keystore) for Android and [iOS KeyChain](https://developer.apple.com/documentation/security/keychain_services) for iOS apps.&#x20;
* **Websites:** Store the `access_token` in memory, the `refresh_token` is automatically included in an `httpOnly` and `Secure` cookie with domain `cotter.app` that is automatically included when requesting to refresh token. [Learn more on how to store JWT tokens securely.](https://dev.to/cotter/localstorage-vs-cookies-all-you-need-to-know-about-storing-jwt-tokens-securely-in-the-front-end-15id)

{% hint style="success" %}
Cotter's SDK generally handles token storage in your app.
{% endhint %}

### SDK Support

Some of our SDKs handles storing the tokens for you:

* **JavaScript** (from npm): [Getting the Logged-in User and OAuth tokens](/sdk-reference/web/getting-access-token-and-logged-in-user-info.md)
* **React Native**: [Getting the Logged-in User and OAuth tokens](/sdk-reference/react-native/getting-stored-oauth-tokens-and-user-information.md)
* **Flutter**: [Getting the Logged-in User](/sdk-reference/flutter/getting-the-logged-in-user.md) and [OAuth tokens](/sdk-reference/flutter/getting-oauth-tokens.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cotter.app/getting-access-token/storing-and-removing-tokens.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
