Obtain and return the Jimeng site's sessionid Cookie (returns the value only, does not write to a file).
Dependencies
This skill depends on Playwright MCP, requires a registered Playwright MCP service in the runtime environment, and can call the following browser tools:
browser_navigatebrowser_snapshot(or similar page state reading tools)browser_run_codebrowser_close
If the above capabilities are missing, this skill cannot complete the login check and Cookie extraction process.
Playwright MCP installation example
It is recommended to explicitly specify profile(via --user-data-dir), so that the Jimeng login state can be persisted without having to log in again each time.
The following are common installation methods (choose one according to your client):
Claude Code
claude mcp add playwright npx @playwright/mcp@latest -- --user-data-dir "$HOME/.yoitao/mcp/playwright-jimeng-profile"
Codex
codex mcp add playwright npx @playwright/mcp@latest -- --user-data-dir "$HOME/.yoitao/mcp/playwright-jimeng-profile"
After installation, it is recommended to restart the client, then run this skill.
Trigger scenarios
- The user requests to obtain Jimeng
sessionid - Other skills (such as the image generation skill) need Jimeng authentication credentials
- Existing
sessionidhas expired and needs to be re-fetched
Workflow
1) Open the Jimeng page
Navigate to:
https://jimeng.jianying.com/ai-tool/home
2) Check login status
- If a "Log in" button appears on the page: prompt the user to complete login first, and keep the browser window open
- If membership information appears on the page (such as "Basic Member" or "Premium Member"): continue to the next step
3) Read Cookies
Run the script to read Cookies:
async (page) => {
const cookies = await page.context().cookies();
const sessionCookie = cookies.find(
(c) =>
c.name === "sessionid" &&
(c.domain.includes("jimeng.jianying.com") || c.domain.includes("jianying.com")),
);
return sessionCookie ? sessionCookie.value : null;
}
Note: The Cookie name is lowercase sessionid, not sessionId。
4) Return the result and clean up
- Fetch successful: directly return the
sessionidvalue - Fetch failed: return "sessionid not found, it is recommended to refresh and try again"
- Finally, close the browser resources
Key parameters
| Item | Value |
|---|---|
| Target site | https://jimeng.jianying.com/ai-tool/home |
| Cookie name | sessionid(lowercase) |
| Domain matching | jimeng.jianying.com / jianying.com |
Notes
sessionidwill expire and needs to be refreshed as needed.- If the Cookie still cannot be obtained after login is complete, refresh the page first and try again.