---
title: "Manage session traits"
slug: "manage-session-traits"
abstract: "Explains how to search, edit, pause, deactivate, duplicate, delete, copy, or view details of session traits in Sitecore CDP."
---
# Manage session traits

This topic provides information on how to search, edit, pause, deactivate, duplicate, and delete a session trait, copy its ID, and copy its code to a new session trait.

Only team members with a *Developer* or *Admin* role in Sitecore Cloud Portal can manage session traits.

## Search for a session trait

You can easily search for a session trait by selecting its type, searching by name or identifier, or using filters.

To search for a session trait:

1. In the navigation pane, click **Developer center** > **Session traits**.
2. On the **Session Traits** page, search for a session trait by its name, identifier, or content.
3. Optionally, apply these filters to locate a session trait:
    - **Tags** - filter by one or more tags.
    - **Status** - filter on whether the session trait is activated, paused, or has a status of *Draft*.
    - **Last Updated By** - filter by the user who last updated the session trait. To sort the session traits list according to first or last updated, click ![Arrow](https://doc.sitecore.com/api/markdown-image/cdp/en/users/sitecore-cdp/images/purpleUparrow.png) on the column heading.

## Copy code from a session trait

You can copy the JavaScript code of a session trait from the code editor and paste it into a new session trait.

To copy code from a session trait:

1. From the **Session Traits** page, open the session trait from which you want to copy code.
2. Click **Copy** ![Copy icon](https://doc.sitecore.com/api/markdown-image/cdp/en/users/sitecore-cdp/images/copy_data.png) and paste the JavaScript code into the code editor of a new session trait.

## Copy the friendly ID of a session trait

When you create a session trait, Sitecore CDP automatically creates a unique ID for it. You can easily copy this `friendlyId` from the **Details** pane.

To copy the friendly ID:

1. From the **Session Traits** page, open the session trait you want to view.
2. In the **Details** pane, click ![Copy icon](https://doc.sitecore.com/api/markdown-image/cdp/en/users/sitecore-cdp/images/copy_data.png) to copy the Friendly ID of the session trait.

    > [!note]
    > You can use this ID to reference the session trait and [access its value](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/developer-center/session-traits/defining,-storing,-and-accessing-session-traits.html#UUID-79889d12-06ee-5109-5ac2-083d17151698_section-idm234360237762829 "Accessing session trait values in Sitecore CDP") within Sitecore CDP.

## Edit a session trait

You can continue editing a session trait while it is in *Draft* or *Paused* [status](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/developer-center/session-traits/session-trait-statuses.html "Session trait statuses").

To edit a session trait:

1. From the **Session Traits** page, open the session trait you want to edit.
2. Click **Edit** ![The edit icon](https://doc.sitecore.com/api/markdown-image/cdp/en/users/sitecore-cdp/images/edit_pencil.png).
3. Make the necessary changes to the code and click **Save**.

## Pause a session trait

You can pause an *Active* session trait to temporarily stop it from running at the end of each customer's session and storing any new data. Previous values calculated for the paused session trait will remain intact in the respective guest profiles.

To pause a session trait:

1. From the **Session Traits** page, open the session trait you want to pause.
2. Click **Pause**.
3. In the confirmation dialog, click **Pause**.

## Deactivate a session trait

You can deactivate a *Paused* session trait to delete all data associated with it for customer sessions that end after the session trait has been deactivated.

To deactivate a session trait:

1. From the **Session Traits** page, open the session trait you want to deactivate.
2. Click ![Horizontal ellipsis](https://doc.sitecore.com/api/markdown-image/cdp/en/users/sitecore-cdp/images/pers_ellipsCon.png) > **Deactivate**.
3. In the confirmation dialog, click **Deactivate**.

## Duplicate a session trait

You can duplicate a session trait in any status to copy its code, description, and tags into a new session trait.

To duplicate a session trait:

1. From the **Session Traits** page, open the session trait you want to duplicate.
2. Click **Duplicate**.
3. Rename the duplicated session trait and click **Create**.

## Delete a session trait

You can only delete a session trait if it is in *Draft* or *Inactive* status. Before proceeding, check all references to the session trait within Sitecore CDP to prevent data corruption.

> [!important]
> When you delete a session trait, it is removed from the **Session Traits** page. The session trait is also removed from the customer's guest profile after their next session ends. This action deletes the session trait object along with its `friendlyId`, `name`, `value`, and other attributes.
>
> This action is permanent, and the session trait cannot be recovered.

To delete a session trait:

1. From the **Session Traits** page, open the session trait you want to delete.
2. Click ![Horizontal ellipsis](https://doc.sitecore.com/api/markdown-image/cdp/en/users/sitecore-cdp/images/pers_ellipsCon.png) > **Delete**.
3. In the confirmation dialog, click **Delete**.