Session Token
← Back to DP-420 Terminology Reference
Category: Data Distribution & Consistency
Summary: Value guaranteeing a client reads its own writes under session consistency.
Overview
A session token is a value returned by Azure Cosmos DB after a write operation that a client can present on subsequent read requests to guarantee session consistency — ensuring the client reads its own writes ('read-your-own-writes') even when session consistency is used across different replicas or connections.
More Info & Links
DP-420 Style Practice Questions
Q1. What is the primary purpose of a session token in Azure Cosmos DB?
- A. Guaranteeing a client reads its own writes under session consistency
- B. Encrypting data during transmission
- C. Authenticating a user against Microsoft Entra ID
- D. Defining the container's partition key
Q2. When would you need to manually manage session tokens in an application?
- A. When sharing session consistency guarantees across multiple client instances or connections
- B. When using Strong consistency exclusively
- C. When TTL is enabled on the container
- D. When using the Table API only
Answer Key
Answers are listed at the very end so you can attempt the questions first.
- Q1 (Session Token): A. Guaranteeing a client reads its own writes under session consistency — Session tokens ensure read-your-own-writes consistency guarantees when using session consistency.
- Q2 (Session Token): A. When sharing session consistency guarantees across multiple client instances or connections — Manually passing session tokens is needed to maintain consistency guarantees across different client instances/connections.
DP-420: Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB — term detail page