ScreenshotNeo

BlogGuides

Can a Screenshot Service Reuse My Browser Cookies for a Members-Only Page?

A screenshot service can capture a members-only page only if its browser receives valid authentication state. Here’s how cookie sharing works, how to capture locally, and how to protect session credentials.

By the ScreenshotNeo team4 October 20269 min read

Short answer: sometimes, but a screenshot service cannot normally see cookies in your everyday browser by itself. Its browser needs to receive valid authentication state, or it needs to sign in through a supported login flow. Whether that works depends on the screenshot service and how the members-only site authenticates users.

For a one-off capture, a local browser session you are already signed into avoids sending session cookies to another provider. For remote or scheduled capture, check that the service explicitly supports the authentication method your site requires. ScreenshotNeo is a website screenshot API and MCP server, but its documented options here include custom cookies and headers, not automatic access to cookies in your personal browser. You must supply the required state yourself.

What “reuse my browser cookies” can mean

There are two different browser sessions involved:

  • Your everyday browser: it already has cookies and other state from your login.
  • The screenshot browser: usually a separate browser process or context created for a capture.

A remote screenshot service generally starts its own browser session. It does not automatically inherit the cookies stored by Chrome, Firefox, Safari, or another browser on your computer. To authenticate that separate session, you need a supported route: provide cookies or saved browser state, configure HTTP authentication, or perform a login flow the service supports.

Even when you can provide cookies, cookies may not be the whole login. Playwright documents that authentication state can include cookies, local storage, IndexedDB, and passkeys; session storage can require extra save-and-load handling. A cookie accepted by a service may therefore be insufficient for a particular site. See the Playwright authentication guide.

Choose the capture route

  1. One screenshot, no automation requirement: capture from your signed-in local browser. This keeps the session on your machine.
  2. Repeatable local automation: use Playwright and save authenticated state for a dedicated test account.
  3. Remote or scheduled capture: choose a provider that documents the authentication method you need, then send only the required state after reviewing its security and privacy practices.

Before choosing a remote service, verify its support for cookies, HTTP authentication, login steps, or other required state; whether capture runs in a separate or connected browser; how credentials are stored, accessed, retained, and deleted; and whether the target site requires additional authentication. The available endpoint documentation establishes examples of cookie input and authenticated screenshots, but does not provide a comparative security assessment or establish every provider’s data-handling practices.

Capture locally with Playwright

Playwright can save authenticated browser state and load it into a new browser context. This is useful for repeatable captures, but the state file is a credential: anyone who can use valid state may be able to impersonate the account. Use a limited-purpose account where possible and keep the state file out of version control.

1. Install Playwright

npm init -y
npm install playwright
npx playwright install chromium

2. Sign in once and save state

Create save-auth.mjs. Replace the URL and selectors with the site’s actual login page and form fields. This example saves the session after you complete the login in the opened browser.

import { chromium } from 'playwright';

const browser = await chromium.launch({ headless: false });
const context = await browser.newContext();
const page = await context.newPage();
await page.goto('https://members.example.com/login');

// Complete sign-in in the opened browser, including any MFA prompt.
// Then navigate to a page that is visible only when signed in.
await page.goto('https://members.example.com/account');
await page.waitForLoadState('domcontentloaded');

// Store this file outside source control; it contains session credentials.
await context.storageState({ path: 'playwright/.auth/member.json', indexedDB: true });
await browser.close();

The Playwright authentication guide recommends keeping the authentication-state directory out of version control. Add playwright/.auth/ to .gitignore and restrict access to the file. Support for saved state options can vary by the Playwright version; consult the current API documentation if an option is rejected.

3. Load the state and capture a page

Create capture.mjs. This checks a page-specific selector before taking the screenshot so a redirect to the login page does not silently look like a successful capture.

import { chromium } from 'playwright';

const browser = await chromium.launch({ headless: true });
const context = await browser.newContext({
  storageState: 'playwright/.auth/member.json'
});
const page = await context.newPage();

try {
  await page.goto('https://members.example.com/reports', {
    waitUntil: 'domcontentloaded',
    timeout: 45_000
  });

  // Replace this with a stable element that exists only on the signed-in page.
  await page.locator('[data-testid="report-content"]').waitFor({ timeout: 15_000 });
  await page.screenshot({ path: 'members-report.png', fullPage: true });
} finally {
  await browser.close();
}

Run it with node capture.mjs. For an authentication check, use a selector that identifies the protected content rather than relying only on a successful navigation or HTTP response: a login page can load successfully too.

Authentication state edge cases

  • Expired or rotated session: sign in again and regenerate the state file. Many sites expire sessions or invalidate them after a password change or security event.
  • Local storage or IndexedDB: confirm the saved state includes the mechanism the application uses. Cookies alone may not restore the session.
  • Session storage: Playwright notes that this may need custom save/load handling; do not assume a normal storage-state file contains it.
  • Passkeys or MFA: a saved cookie may bypass a new challenge only while the site considers the session valid. A fresh login may require interactive or site-specific handling.
  • Domain and path scope: a cookie must be applicable to the requested host and path, and its security attributes and expiry must remain acceptable to the site.
  • Bot checks or IP/device binding: the site may reject a session used from a different browser, network, or environment. This behavior is site-specific.

Passing cookies to a remote screenshot API

Some screenshot APIs document a cookie parameter; that does not mean all services accept cookies, nor does it guarantee the target site will accept them. For example, a screenshot API’s documentation describes a cookies parameter made of name/value pairs set for the target host before page load. Cloudflare Browser Run documents authentication options, including cookies, for its Quick Actions endpoints and screenshot endpoint. These are examples of explicit support, not automatic access to your local browser session. Check the provider’s current documentation for its exact syntax and behavior.

For ScreenshotNeo, the API accepts custom cookies and headers as capture options. Use the ScreenshotNeo documentation for the current parameter format and authentication setup. The service cannot infer the cookie jar in your local browser: you need to provide the state accepted by the target page, and that state may not cover local storage, session storage, or other login requirements.

Protect the session credentials

Playwright warns: “The browser state file may contain sensitive cookies and headers that could be used to impersonate you or your test account.” Treat exported state and copied cookies like passwords.

  • Prefer local capture when it satisfies the need and avoids transferring session state.
  • Use a dedicated account with the minimum access required, if the site permits one.
  • Supply only the state necessary for the capture; do not send a whole browser profile when a narrower method works.
  • Review the provider’s current security and privacy documents for storage, retention, access, and deletion details. An endpoint feature description does not answer those questions.
  • Keep state files out of source control, build logs, shared artifacts, and public storage.
  • If live state is exposed, revoke or rotate the session using the site’s account controls where available.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. Make one GET request with the page URL and your API key; for a members-only page, supply the authentication state the site requires using the documented cookie or header options. This call by itself does not import cookies from your everyday browser.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" \
  -d access_key=YOUR_API_KEY \
  --data-urlencode url=https://members.example.com/reports \
  --data-urlencode format=png \
  -o members-report.png

Python

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={
        "access_key": "YOUR_API_KEY",
        "url": "https://members.example.com/reports",
        "format": "png",
    },
    timeout=90,
)
r.raise_for_status()
with open("members-report.png", "wb") as image:
    image.write(r.content)

Node.js

const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://members.example.com/reports',
  format: 'png',
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await Bun.write('members-report.png', new Uint8Array(await res.arrayBuffer()));

These examples capture a URL; they do not include a cookie because the exact cookie parameter format depends on the current API documentation. Configure the required cookie or authorization header as documented, and do not put live credentials in shell history, committed code, or logs. ScreenshotNeo also supports an MCP server for AI agents, with take_screenshot, get_page_info, and capture_pdf tools.

Cookie banners, newsletter popups, and chat widgets are removed before the shot, and each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing; response headers identify the page verdict and billing status. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for 1,000 free screenshots a month, with no card.

Troubleshooting

Symptom Likely cause What to do
The screenshot shows a login page The capture browser did not receive valid state, the state expired, or the site needs more than cookies. Check the protected-page selector, refresh the saved state, and verify which storage mechanisms the site uses.
Navigation succeeds but protected content is missing A login redirect or client-side auth failure can still return a page successfully. Wait for a stable protected-content selector and inspect the final URL and page content before saving.
Cookie is present but rejected It may be expired, scoped to a different domain/path, or tied to a browser or network context. Obtain fresh state through the site’s normal sign-in flow and check the service’s cookie format and target host rules.
State file does not restore the session The app may depend on local storage, IndexedDB, session storage, passkeys, or another mechanism. Review the app’s auth design and Playwright state guidance; implement any additional save/load handling the site requires.
Remote service returns a bot challenge or access denial The target site may block automated traffic or require a different login flow. Confirm the provider supports the site’s required flow and check the target site’s access rules. Do not treat cookie input as a guarantee of access.
Screenshot is blank or incomplete Capture may happen before client rendering, fonts, or protected content finish loading. Wait for a meaningful selector or an appropriate readiness condition, and verify the page in the same browser context first.
Playwright reports a timeout The page may keep background requests open, load slowly, or never reach the requested condition. Use a suitable navigation condition, set bounded timeouts, and wait for the specific content needed rather than an overly broad network-idle condition.
State works locally but not remotely The remote environment differs in IP, browser, or other context, or the provider does not support the needed state. Check provider authentication documentation and its handling of the state; test with a limited-purpose account.

Performance, reliability, and cost

  • Performance: reusing valid state avoids repeating a full interactive sign-in for every capture, but the page’s own scripts and resources still determine much of the load time. Wait for the content you need rather than every network connection to end.
  • Reliability: browser state is temporary by nature. Expiration, rotation, MFA, site changes, and bot controls can interrupt scheduled captures. Add an explicit authenticated-content check and handle re-login or failure instead of saving a login screen as if it were valid output.
  • Cost: local Playwright has no screenshot-service request charge, though you operate the browser environment. Remote services may charge according to their own terms. ScreenshotNeo says only clean shots are billed; bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, with page verdict and billing status included in response headers.
  • Credential risk: transferring cookies trades local isolation for remote automation. Consider the value of scheduling and centralized capture against the risk of exposing a credential capable of impersonating the account.

FAQ

Can a screenshot API access cookies from Chrome on my computer?

Not automatically in the usual remote-browser workflow. You must use a supported connected-browser workflow or explicitly provide authentication state.

No. Some sites also rely on local storage, IndexedDB, session storage, passkeys, or a fresh login challenge.

Does seeing a login page mean the screenshot service is broken?

No. It can mean the state was missing, expired, insufficient, or unsupported. Diagnose against the particular site and provider.

Can I safely send session cookies to a screenshot provider?

That depends on your threat model and the provider’s current data-handling practices. Session cookies can permit impersonation, so review storage, access, retention, and deletion terms before sending them.

Sources