# Web session

Explore what information is available for web sessions.

This type represents a summary of a user's activity in a web application, providing valuable insight into user behavior and engagement.

In addition to the properties listed below, the web session supports additional properties called [*custom attributes*](#web-session-attribute-prop).

These attributes are useful if you want to store additional information that is only relevant during the session. For example, you could set a `plan` attribute to store the plan the user selected and use it later in the session for personalization purposes.

## Properties

These are the available properties:

- `start`: `DateTime`

  The start time of the session, corresponding to the time of the first interaction in the session.

- `end`: `DateTime`

  The end time of the session, corresponding to the time of the last interaction in the session.

- `duration`: [`Duration`](/reference/cql/data-types/date-time/duration)

  The duration of the session until the last interaction. It is calculated as the difference between the start time and the end time.

- `landingPage`: `URI|null`

  The URL of the page the user landed on in the current session. It is not available if the starting page is unknown.

- `referrer`: `URI|null`

  The URL of the page that linked to the page the user landed on in the current session. It is not available if the initial page is accessed directly.

- `stats`: [`WebSessionStatistics`](../session/web-session-statistics)

  The aggregate statistics of the session.

- `<attribute>`: `primitive|collection<primitive>|null`

  A custom attribute, where `/*<attribute>*/` is the name of the attribute.

  You can access any custom attribute just like any other property. For example, if you have defined a custom property named `plan`, you can access it like this:

  ```cql
  session's plan
  ```

  If a custom attribute has the same name as a predefined one, it takes precedence and hides the predefined attribute without overwriting it. Removing the custom attribute exposes the predefined one again.
