# Day(s) Since Last Session criterion

The Day(s) since last session criterion is a segmentation criterion that enables defining a [segment](/assets-library/creating-and-managing-segments.md).

To learn how to create a segment, please refer to this [article](/web-experimentation-and-personalization/targeting-step/how-to-create-a-segment-who-section.md).

## 📖 Definition <a href="#h_01hhpfr6m3c7a5d80cbts8rw4v" id="h_01hhpfr6m3c7a5d80cbts8rw4v"></a>

The Day(s) since last session criterion enables you to create an audience segment based on the date of your visitors’ last visit (or session).

{% hint style="info" %}
A session ends after 30 minutes of inactivity.
{% endhint %}

### 🔎 How Does It Work? <a href="#h_01hhpcyeh3r9x758f97wt1cbn8" id="h_01hhpcyeh3r9x758f97wt1cbn8"></a>

AB Tasty records the date of their last session using a specific `ABTasty` cookie placed on the visitor’s browser. AB Tasty sets a value for each visitor in a specific variable (key is `pst` for “previous session timestamp”). When the visitor returns to the website, AB Tasty checks the amount of time that has passed between this timestamp and the current date and approves visitor inclusion into the segment (or not).

<img src="https://pf-emoji-service--cdn.us-east-1.prod.public.atl-paas.net/standard/caa27a19-fc09-4452-b2b4-a301552fd69c/64x64/1f449.png" alt="backhand index pointing right" data-size="line"> [See Consent policy, cookies and storages documentation](/account/performance-and-security/consent-policy---cookies-storage-and-privacy.md)

This segmentation criterion is based on the AB Tasty cookie that saves the number of sessions. If the user clears their cookies, uses a new browser, another device, or the incognito mode to visit your website, they will be considered as a new user and AB Tasty will be unable to acknowledge them as part of the segment or to count their new session.

## ⚙️ Configuration <a href="#h_01hhpfr6m38pza82j7jhxefq7v" id="h_01hhpfr6m38pza82j7jhxefq7v"></a>

To use this criteria, drag and drop the **Days Since Last Session** label inside the middle column of the segment builder. You will have to choose from the following operators to configure your segment, which will determine the operation behind the value you will declare:

* **`is equal or greater than`**: the visitor will be targeted only if their last session occurred a number of days equal or higher than the number of days submitted.
* **`is equal or lower than`**: the visitor will be targeted only if their last session occurred a number of days equal or lower than the number of days submitted.

Then enter the required value inside the number field.

<figure><img src="/files/m7wnebU3w6HeGomPWDhI" alt="" width="563"><figcaption></figcaption></figure>

Let’s say a user visited your website 25 days ago and has not returned. If you have created a segment based on the **Days Since Last Session** criteria with the value **`25`**, the user will join your segment precisely four days after its creation, as soon as he returns to your website.

{% hint style="info" %}
The number in the “days” field needs to be reached. If you enter 15, the number of days between the last session and the day of the return visit will have to equal at least 15.
{% endhint %}

## 💡 Use case <a href="#h_01hhpfr6m3jqwckyxes3jyjv1e" id="h_01hhpfr6m3jqwckyxes3jyjv1e"></a>

Basing yourself on the “Days since last session” criterion could enable you to create an audience segment targeting all users who haven't returned for a long time (this notion being specific to each business) in order to push a “Welcome back Message”.

Used in combination with the “Number of sessions” criterion, it would enable you to create a segment of formerly very active visitors (recurring high visits) who have not returned at all for a while.

**Need additional information?**

Submit your request at <product.feedback@abtasty.com>

Always happy to help!

<img src="/files/KMDnijxnVIK8imiHr7x4" alt="" width="146">


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.abtasty.com/assets-library/creating-and-managing-segments/list-of-segment-criteria/days-since-last-session-criterion.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
