Daily iOS
Security

Session token lifetime

Your app puts the token the server returned at login into the header of every request. An interviewer asks when that token is created and when it expires, so how do you answer?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

The server issues the token when login succeeds, you split it into a short-lived access token (minutes to an hour) and a long refresh token, and the server decides expiry while the client renews on a 401 or on the expiry time.

Share a question