Skip to content
BENIBIX Learn

Refresh Token

Development🔑 AuthSessions and Tokens

Also known as Refresh Tokens, Token Refresh

A token that lasts a long time. It is only used to get new access tokens.

Think of it like

Think of it like a season ticket. When your day pass runs out, it gets you a new one.

Example

Emma's access token expires at noon. Her app sends its refresh token, gets a new access token, and she never sees a login screen.

Why it matters

Users stay logged in for weeks. Each access token still runs out soon, which is safer.

Definition

A refresh token lasts a long time and is only used to get new access tokens. Access tokens run out fast, often within an hour, so the app would keep asking you to log in. Instead, it quietly trades the refresh token for a fresh access token. Refresh tokens can last days or months. They are sent only to the login server, never to every API.

Common mistake

Never changing the refresh token. Give a new one each time it is used, so a stolen copy is caught and stops working.

Key takeaways

  1. 1
    Gets new access tokens. Nothing else.
  2. 2
    Lives longer. Days or months.
  3. 3
    Sent rarely. Only to the login server.

Compare