> For the complete documentation index, see [llms.txt](https://docs.ipwo.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ipwo.net/dai-li-ji-chu-zhi-shi/shen-me-shi-nian-xing-hui-hua.md).

# 什么是粘性会话

[粘性会话](/huo-qu-yu-pei-zhi-dai-li/nian-xing-ip.md)（Sticky Session）是一种让代理 IP 在一段时间内保持不变的连接方式。

简单来说：

👉 在指定时间内，系统会尽量保持使用同一个 IP。

***

### 🌍 为什么需要粘性会话？

正常动态代理：

```
第一次请求 → IP A
第二次请求 → IP B
第三次请求 → IP C
```

而粘性会话：

```
第一次请求 → IP A
第二次请求 → IP A
第三次请求 → IP A
```

👉 IP 会在一段时间内保持稳定。

***

### ⚙️ 粘性会话的工作原理

粘性会话通常通过：

```
Session ID（会话 ID）
```

来绑定代理 IP。

例如：

```
sid_12345
```

系统会：

👉 尽量为该 Session 分配同一个 IP。

***

### ⏱ 什么是粘性时间？

很多代理支持：

```
time_10
```

表示：

👉 IP 保持 10 分钟不变。

***

### 📌 常见粘性时间

| 参数       | 含义       |
| -------- | -------- |
| time\_10 | 保持 10 分钟 |
| time\_30 | 保持 30 分钟 |
| time\_60 | 保持 60 分钟 |

***

### 🌐 粘性会话示例

例如：

```
username_custom_zone_US_sid_12345_time_30
```

表示：

* 美国 IP
* Session ID 为 12345
* IP 保持 30 分钟不变

***

### 🔒 粘性会话适合哪些场景？

常见场景：

| 场景                                                           | 推荐 |
| ------------------------------------------------------------ | -- |
| [TikTok 运营](/ying-yong-chang-jing/tiktok-yun-ying.md)        | ✅  |
| [Facebook 广告](/ying-yong-chang-jing/facebook-guang-gao.md)   | ✅  |
| [Amazon 店铺](/ying-yong-chang-jing/amazon-dian-pu-guan-li.md) | ✅  |
| [多账号管理](/ying-yong-chang-jing/duo-zhang-hao-guan-li.md)      | ✅  |
| 长时间登录                                                        | ✅  |

***

### ⚠️ 为什么账号业务推荐粘性会话？

因为很多平台会检测：

* IP 是否频繁变化
* 网络环境是否稳定

如果 IP 经常变化，可能会出现：

* 登录验证
* 风控提示
* 账号异常

👉 粘性会话更适合长期稳定环境。

***

### 🔄 粘性会话 ≠ 永久固定 IP

很多用户容易误解：

粘性会话：

👉 只是“在一定时间内尽量保持同一个 IP”。

不是：

```
永久固定 IP
```

***

### 📌 粘性会话与轮换 IP 区别

| 类型      | 粘性会话  | 轮换 IP |
| ------- | ----- | ----- |
| IP 是否变化 | 短时间稳定 | 自动变化  |
| 适合场景    | 账号运营  | 数据采集  |
| 稳定性     | 更高    | 更灵活   |

***

### 🌍 粘性会话的优势

粘性会话通常：

* 网络更稳定
* 更适合登录环境
* 更接近真实用户行为

***

### ⚡ cURL 示例

```bash
curl -x "us.ipwo.net:7878" \
-U "username_custom_zone_US_sid_12345_time_30:password" \
ipinfo.io
```

***

### 🖥 使用后会发生什么？

在 30 分钟内：

👉 多次请求通常会返回同一个 IP。

***

### ❗ 常见问题

#### 为什么 IP 还是变了？

可能原因：

* 粘性时间已结束
* 当前 IP 已失效
* 网络连接中断

***

#### 粘性时间越长越好吗？

不一定。

不同业务需求不同：

* 长时间登录 → 更长粘性
* 普通请求 → 较短粘性

***

#### 数据采集推荐粘性会话吗？

通常：

👉 高频采集更推荐轮换 IP。

***

### 🆘 遇到问题怎么办？

如果出现：

* IP 频繁变化
* Session 不生效
* 登录异常

建议优先检查：

* sid 参数是否正确
* time 参数是否设置
* 当前网络环境是否稳定

***

### 总结

粘性会话的核心原理：

```
Session ID
↓
绑定代理 IP
↓
短时间保持稳定
```

👉 粘性会话更适合需要稳定网络环境的业务场景

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.ipwo.net/dai-li-ji-chu-zhi-shi/shen-me-shi-nian-xing-hui-hua.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.
