Session
A session is a bounded interaction or execution context associated with a user, client, process, or service that groups related exchanges or operations and may retain state.
Build Python Web Apps with Streamlit
st.session_state is Streamlit's session-scoped state store for retaining values across reruns of an app session.
- How it is used
- Retains app values across reruns and supplies keyed widget defaults within a browser session.
- How deep it goes
- Explains initialization, dictionary-like operations, widget ordering, and testing, while leaving durable storage outside the session-scoped to-do example.
- Examples
- Uses an incrementing counter, a daily task list, URL-populated dashboard widgets, and mocked movie-search tests.
- What you can do after
- Apply it via Streamlit to preserve values across reruns, set widget defaults, and inspect state in frontend tests.
Read how Build Python Web Apps with Streamlit explains session →
Designing AI Systems
A session is a structured record representing one conversation between a user and an AI application, including its messages and identifying metadata.
- How it is used
- Provides persistent conversation history so follow-up requests can use earlier exchanges.
- How deep it goes
- Defines session and message fields, then develops service operations, storage design, and context-window trade-offs.
- Examples
- Uses patient appointment scheduling and a restaurant-recommendation conversation to illustrate tool history and multi-turn continuity.
- What you can do after
- Builds a session-backed workflow that retrieves history, supplies context to a model, and stores exchanges.
Pro ASP.NET Core 7, Tenth Edition
Session state is client-specific data stored on the server for access across multiple requests within a session.
- How it is used
- Keeps shopping-cart state and other client-specific data available across related requests.
- How deep it goes
- Works through service registration, middleware placement, storage choices, options, keyed access, and commits without detailing cache internals.
- Examples
- Uses a request counter endpoint and a JSON-serialized shopping cart to demonstrate persistence across requests.
- What you can do after
- Operate/configure it to retain per-client values across requests and detect cache-write failures with CommitAsync.
Read how Pro ASP.NET Core 7, Tenth Edition explains session →
AI for Everyday IT
A chat session is a distinct conversational interaction with its own retained interaction context.
- How it is used
- Uses sessions to keep related conversational context together for coherent follow-up interactions.
- How deep it goes
- Defines isolated session context and discusses history limits, coherence problems, and ways to restore focus.
- Examples
- Uses separate employee-review chats and a two-month conversation that exceeded effective context capacity.
- What you can do after
- Apply session practices by keeping related work together, summarizing important context, and carrying essentials into a new chat.
AI-Powered Search
A session is a bounded sequence of interactions associated with a user or client context during a period of activity.
- How it is used
- Uses sessions to preserve search context and turn user interactions into signals for relevance learning.
- How deep it goes
- Defines identifier scope and shows session-level click data, but stops short of specifying a universal session-timeout rule.
- Examples
- Uses a Transformers movie query, session 3, ranked documents, click flags, pandas inspection, and CTR aggregation.
- What you can do after
- Apply session records via pandas to inspect interactions and prepare click-based judgments for learning to rank.
Python How-To
Session state is per-session storage that preserves application data across reruns of a web application script.
- How it is used
- Preserves user choices and activity across Streamlit reruns while a browser tab remains active.
- How deep it goes
- Defines key-value storage and demonstrates initialization, updates, filtering state, and menu-based routing.
- Examples
- Uses a task-management app with menu selection, working-task storage, and sorting and filtering dictionaries.
- What you can do after
- Operate/configure Streamlit applications that retain menu, task, sorting, and filtering choices across input-triggered reruns.
Rust Web Development
A session is the example application's state object for identity information and other data associated with a client's interaction.
- How it is used
- Carries account identity and token timing claims from validated requests into route handlers through authentication middleware.
- How deep it goes
- Defines a Rust Session struct and explains how token validation deserializes it for middleware.
- Examples
- Uses account_id, expiration, and not-before fields in a Session struct and adds authentication filtering to question updates.
- What you can do after
- Apply it via Warp authentication middleware to pass validated session data to route handlers and reject invalid tokens.
MongoDB 8.0 in Action, Third Edition
A client session is an application-created MongoDB session context that groups operations and supports transactions, ordering, and related settings.
- How it is used
- Groups transaction operations while preserving their order, causal relationships, and shared transaction context.
- How deep it goes
- Explains session association, transaction options, cleanup, and labeled-error retries through mongosh and driver examples.
- Examples
- Demonstrates account, customer, and transaction updates using mongosh, Node.js, PyMongo, and Ruby callback APIs.
- What you can do after
- Operate/configure transactions by creating sessions, associating operations, selecting concerns, cleaning up, and handling retries.
Read how MongoDB 8.0 in Action, Third Edition explains session →
Context Engineering
An ongoing interaction between a user and an assistant.
- How it is used
- Maintains conversational continuity by replaying a curated view of prior turns and agent actions on each call.
- How deep it goes
- Explains last-turn trimming and summary-based curation, while leaving implementation plumbing aside.
- Examples
- Uses an evening-flight preference across turns and illustrates last-N-turn retention with a running summary.
- What you can do after
- Apply the OpenAI Agents SDK Session abstraction with deterministic trimming or summary-based compression.
Also covered in
- Spring Security in Action, Second Edition
- Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS
- Grokking Web Application Security
- Python Concurrency with asyncio
- Coding with AI
- Software Security for Developers
- Hugging Face in Action
- The Well-Grounded Python Developer: How the pros use Python and Flask
- Build an AI Agent (From Scratch)
- AI Agents in Action
- Go in Practice, Second Edition
- Learn Go with Pocket-Sized Projects
What to know first
- PythonPython is a high-level, general-purpose, dynamically typed programming language with readable syntax and support for multiple programming paradigms.
- HTTPHTTP is an application-layer protocol that defines request-and-response communication for transferring resource representations and related metadata between networked systems.
- language modelA language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- web applicationA web application is software that provides functionality through web technologies and is accessed over a network, typically through a browser or other web client.
Related concepts
- Enter-PSSessionpart of · Enter-PSSession is a PowerShell cmdlet that starts an interactive session with a local or remote computer.
- Invoke-Commandpart of · Invoke-Command is a PowerShell cmdlet that runs commands or scripts on local or remote computers.
- persistent connectionkind of · A persistent connection is a communication link kept open for reuse across multiple messages, requests, or operations rather than reestablished for each exchange.
- trajectoryhas part · A trajectory is an ordered record of states, actions, events, or operations showing how an agent or system progresses through an execution or process.
Questions about session
What is session?
A session is a bounded interaction or execution context associated with a user, client, process, or service that groups related exchanges or operations and may retain state.
Which Manning books explain session?
Build Python Web Apps with Streamlit, Designing AI Systems, Pro ASP.NET Core 7, Tenth Edition, AI for Everyday IT, AI-Powered Search, Python How-To, Rust Web Development, MongoDB 8.0 in Action, Third Edition and 1 more.
What should I know before learning session?
Manning books that teach session usually introduce Python, HTTP, language model and web application first.
What kinds of session are there?
Kinds of session include disconnected session and reusable session.
What is session a kind of?
Session is a kind of persistent connection. A persistent connection is a communication link kept open for reuse across multiple messages, requests, or operations rather than reestablished for each exchange.
What is session part of?
Session is part of Enter-PSSession. Enter-PSSession is a PowerShell cmdlet that starts an interactive session with a local or remote computer.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.








