# Session Window

> It stays open while events come. It shuts when they stop for a while.

**Field:** Data Engineering  
**Category:** Processing  
**Also known as:** Session Windowing, Gap Window

## Think of it like

It is like a phone call. It lasts as long as people keep talking, and it ends after a long quiet.

## Definition

A session window groups events that come close together and closes after a gap with no events. Its size is not fixed: a busy user makes a long session, a quick visit makes a short one. Windows are kept per key, such as per user. A 30-minute gap is a common setting for website visits.

## Example

A shopper browses for 12 minutes, leaves for an hour, then comes back. With a 30-minute gap, that makes two sessions.

## Why it matters

It matches how people really use apps. Visits, games and calls all come in bursts.

## Common mistake

Picking a gap that is too long. Separate visits get joined into one long session.

## Three principles

- **Closes on a gap.** No events for a set time.
- **No fixed size.** Long or short as needed.
- **Per key.** Each user has their own.

## Related terms

- [Windowing (Stream Processing)](https://learn.benibix.com/term/data/windowing)
- [Tumbling Window](https://learn.benibix.com/term/data/tumbling-window)
- [Sliding Window](https://learn.benibix.com/term/data/sliding-window)
- [Event Time](https://learn.benibix.com/term/data/event-time)

![Three timelines of the same dots. Tumbling windows cut the line into boxes that touch and never overlap. Sliding windows overlap, so one dot falls in more than one box. Session windows wrap each burst of dots and close after a gap.](https://learn.benibix.com/diagrams/stream-windows.svg)

---

Source: https://learn.benibix.com/term/data/session-window
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
