# Session State

*noun*

say it: **“SESH-un stayt”** **/ˈsɛʃən steɪt/**

Small values the server keeps for one visitor between requests, found again through a session cookie.

## What is **Session State** in ASP.NET Core?

**Session State** — Small values ASP.NET Core keeps on the server for one visitor between requests, such as their cart id. The browser holds only a cookie with the session's id, and the values themselves stay on the server.

```csharp
HttpContext.Session.SetString("CartId", "42");
string? cartId = HttpContext.Session.GetString("CartId"); // "42" on the next request too
```

## In a sentence

- “We keep the visitor's cart id in **session state** between page visits.”

Level: Journeyman · [More ASP.NET Core terms at this level](https://www.ask-codey.com/glossary?category=aspnet-core&level=3)

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/session-state
