> ## Documentation Index
> Fetch the complete documentation index at: https://help.decodo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 自定义粘性会话

> 移动代理持续时间规范

## 粘性代理

Decodo **粘性**会话允许代理IP地址在轮换到不同IP地址之前持续最多\*\*`24小时`**（**`1440`\*\*分钟）。

<Note>
  **默认**粘性会话时间为`10分钟`。
</Note>

***

## 仪表板代理列表生成

要**生成**端点列表，请导航至[**仪表板 → 代理设置**](https://dashboard.decodo.com/mobile-proxies/proxy-setup)部分。

<Note>
  在代理设置页面上，您可以从下拉菜单中选择`1`、`10`、`30`或`60`分钟会话，或指定最多`24小时`的**自定义持续时间**。
</Note>

<img src="https://mintcdn.com/decodo/IsWPiMoisao6W8vC/images/docs/e26eac35c6c507b51c0ac196513fa6f7068d0d4250697c984dea83541685d83f-Group_427322980.png?fit=max&auto=format&n=IsWPiMoisao6W8vC&q=85&s=5b169b7f1fc761d4ffd85aa521a789fc" alt="" width="3448" height="1552" data-path="images/docs/e26eac35c6c507b51c0ac196513fa6f7068d0d4250697c984dea83541685d83f-Group_427322980.png" />

## 自定义会话持续时间

您可以将`sessionduration`参数与代理**用户名**或**白名单IP**一起使用，以将会话长度延长至最多\*\*`24小时`**（**`1440`\*\*分钟）。

<Note>
  * `sessionduration`参数接受`1`到`1440`之间的任何**整数**（分钟）值。
  * `1440`分钟持续时间是最长的代理会话。
</Note>

<Warning>
  ### 提前轮换

  会话时间越长，由于末端移动设备离线，**IP在您指定的时间之前轮换**的可能性就越大。
</Warning>

## 多个并发粘性会话

将`session`变量添加到代理用户名或使用白名单IP将允许代理IP地址在多个请求中持续存在。

<Note>
  不同的会话参数值用于区分活动会话，其行为就像我们国家端点的不同粘性代理端口一样。

  * `session-1`
  * `session-2`
</Note>

## 示例

### 用户名:密码

使用\*\*`90分钟`**长的`sessionduration`参数与代理**用户名\*\*和`session` **ID**一起使用的`cURL`示例，以允许IP地址在多个请求中持续存在：

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -U "user-username-session-example1-sessionduration-90:password" -x "gate.decodo.com:7000" "ip.decodo.com"
  ```
</CodeGroup>

### 白名单IP

使用\*\*`90分钟`**长的`sessionduration`参数与**白名单IP\*\*和`session` **ID**一起使用的`cURL`示例，以允许IP地址在多个请求中持续存在：

<CodeGroup>
  ```shellscript cURL theme={null}
  curl -x "https://session-example1-sessionduration-90.gate.decodo.com:7000" "https://ip.decodo.com"
  ```
</CodeGroup>

<Note>
  查看[**回连**](https://help.decodo.com/docs/cn/mobile-proxy-user-pass-requests#sticky-session)指南，深入了解如何使用带有`sessionduration`和`session`参数的粘性会话。
</Note>

***

<Columns cols={2}>
  <Card title="支持" href="https://direct.lc.chat/12092754" cta="让我们聊聊！">
    需要帮助或只是想打个招呼？我们的支持团队全天候为您服务。 \
    您也可以随时通过电子邮件 [support@decodo.com](mailto:support@decodo.com) 联系我们。
  </Card>

  <Card title="反馈" href="mailto:feedback@decodo.com" cta="分享反馈">
    找不到您要找的内容？请求一篇文章！ \
    有反馈意见？分享您对我们如何改进的想法。
  </Card>
</Columns>
