> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-zh/cao-zuo-zhi-nan/cookie/import-cookie.md).

# 导入Cookie

导入 cookie 是将可用的 cookie 数据结构字符串或文件加载到浏览器中，以便账户自动登录成功，而无需填写用户名/密码。

#### 配置参数：

* Cookie 文件：指向包含 cookie 结构的 `.json` 文件的绝对路径（或直接传递数据变量）。
* 结构格式：必须是标准 JSON 格式。

#### 重要操作注意事项：

* 需要先访问 URL：您必须让浏览器访问正确的目标网站，然后才能调用此操作（例如：先访问 `facebook.com`，然后再导入 Facebook 的 cookie，这样 cookie 才能与正确的域名匹配）。
* 仅在当前会话中有效：加载的所有 cookie 数据仅在该工作会话中有效。一旦关闭浏览器配置文件，这些 cookie 将自动消失，并不会覆盖配置文件的原始数据。


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.gpmautomate.com/automate-zh/cao-zuo-zhi-nan/cookie/import-cookie.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
