# Session 规则

> 怎样的一系列行为算是一个Session？ 通常如下
>
> * iOS应用：用户屏熄、home键切换到后台、杀掉进程、跨天等视为会话结束
> * Android应用：用户杀掉进程、屏熄、按home键超过30秒、跨天等视为会话结束
> * H5/Web应用：用户从打开网页到离开视为一次会话，包括关闭整个浏览器、30分钟未进行新打开页面、触发事件等活动。如果一次访问跨天的话，会被切割成两次会话

**易观方舟根据用户实际访问的场景，抽象成以下四种规则，来判断一次访问，即生成sessionID**

| 切割规则            | 优先级 |
| --------------- | --- |
| 跨天              | 1   |
| 强制切割-帐号切换（暂未上线） | 2   |
| 强制切割-广告来源切换     | 3   |
| 新进程             | 4   |
| 可见页面间隔时间        | 5   |

{% hint style="info" %}
可见页面间隔时间是指上个页面关闭的时间到当前页面打开的时间间隔

打开APP后可能会离开页面（比如调起其他应用、熄屏、退到后台，再次回到页面中），间隔时间超过30s时，会切割Session；

Web端切换到其他网页后再次回到当前页面，间隔时间超过30min时，会切割Session
{% endhint %}

**实际用户的使用场景**

| 场景                               | 规则覆盖         |
| -------------------------------- | ------------ |
| 在Web端访问 → APP端访问（跨屏）             | 跨屏本身换Session |
| 从今天玩到明天                          | 跨天           |
| 帐号 X 使用 APP 后退出登录，切换到帐号 Y        | 强制切割-帐号切换    |
| APP-B 中的 deeplink → APP-A        | 强制切割-广告来源切换  |
| 通过消息通知打开 APP-A                   | 强制切割-广告来源切换  |
| 在APP-A → APP-B中的deeplink → APP-A | 强制切割-广告来源切换  |
| 直接打开 APP-A                       | 新进程          |
| 主动杀掉进程                           | 新进程          |
| 在 APP 中 → 调起支付/分享 →  APP         | 可见页面间隔时间     |
| 在 APP → 接电话 → 回到 APP             | 可见页面间隔时间     |
| 点击home键                          | 可见页面间隔时间     |
| 点击两次返回                           | 可见页面间隔时间     |
| 锁屏                               | 可见页面间隔时间     |
| 熄屏                               | 可见页面间隔时间     |

{% hint style="info" %}
以上内容没有解答我的问题？[点击我来反馈](https://support.qq.com/products/118522/) 🚀
{% endhint %}


---

# 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://arkdocs.analysys.cn/features/analytics/channel/session.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.
