> ## 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/residential-proxies/proxy-setup) 部分。

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

<img src="https://mintcdn.com/decodo/HeowWjVaMvMCJRIK/images/docs/503334b977f053d3a9b2cc09c883d3bc28146011b0842fe49b35ad22aee72516-Group_427322964.png?fit=max&auto=format&n=HeowWjVaMvMCJRIK&q=85&s=0657033a2c29891b11000d4e0f3ebfe1" alt="" width="3448" height="1780" data-path="images/docs/503334b977f053d3a9b2cc09c883d3bc28146011b0842fe49b35ad22aee72516-Group_427322964.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" "https://ip.decodo.com/json"
  ```
</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/json"
  ```
</CodeGroup>

<Note>
  查看 [**backconnect**](https://help.decodo.com/docs/cn/residential-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>
