> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qa.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Session sync

> Keep rotating login tokens current across tests that resume the same login

Some applications replace a login token every time a page loads. A later test that resumes an older saved session then presents a token the application has already used, and the test is logged out.

Session sync keeps the cookie, local storage, and session storage keys configured for an application current across tests that [resume the same login](/core-concepts/dependencies#resume-from). That includes tests running at the same time, a later run that reuses a saved session, and a crawl that explores several pages from one saved login.

## What stays together

| Tests | Shared token |
| :- | :- |
| A test that resumes from the login, and tests that resume from that test | The token written by the login |
| Two logins that both resume from the same earlier test, such as an admin login and a user login | Separate tokens. Each later test follows its own login |
| A test with no Resume From dependency, including a test that only [waits for](/core-concepts/dependencies#wait-for) another test | None. It starts with a fresh browser |

## After you enable it

Run the login test again. Sessions saved before session sync was turned on keep the token they stored, and they do not share later refreshes until that login runs again.

## Limitations

| Situation | What happens |
| :- | :- |
| A test logs out, or the application allows one session per user | The application revokes the token on its server. Other tests cannot stay logged in after that. Give logout tests their own login, or order them with Wait For so they do not run beside tests that still need the session. |
| A test switches accounts by overwriting the token, without logging out first | Treated as a normal refresh. Other tests on that login receive the new account's token. |
| A test logs out and then logs in again | The new login stands on its own. Tests still on the previous login do not receive the new token. |
| The token lives in IndexedDB, or only in the page's memory | Not synced. Cookies, local storage, and session storage are. |
| A guest token and a signed-in token share a name | Configure the signed-in token. A guest token that matches the same name is synced too, and can replace the signed-in value. |
| A session you selected by hand is older than 8 days | Uses the token saved in that session. Newer refreshes are kept for 8 days, one day longer than the longest [Session State Lifetime](/core-concepts/session-state-lifetime). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.