Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
FREEDOM251

Freedom251 › Blog › authentication

How to Schedule Screenshots of a Cookie-Protected Customer Portal Without Saving Passwords

By Freedom251 Team · · 7 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can often schedule screenshots of a signed-in customer portal without storing or re-entering its password on every run. The usual approach is to authenticate through an approved flow once, save the resulting browser state, then load that state in a scheduled Playwright job. Treat that state as a credential: it may let someone impersonate the account. Before automating, confirm the portal permits it and make the job verify that it reached the authenticated page before saving a screenshot.

Check that scheduled access is permitted

Before building the job, confirm that the portal’s terms and your organization’s administrator allow recurring automated access. The portal and its identity provider determine whether this is permitted and how authentication works; Playwright’s documentation cannot establish those portal-specific rules.

As an Amazon Associate I earn from qualifying purchases.

Find out whether an official API or service-account flow is available, and whether interactive sign-in involves SSO, MFA, CAPTCHA, or periodic renewal. Also determine which browser storage mechanisms the portal uses: cookies, local storage, IndexedDB, or sessionStorage. This affects what you need to preserve and whether a saved browser state will be sufficient.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Playwright to save and reuse authenticated state

Playwright documents saving state from an authenticated browser context and loading it into later contexts. Its authentication guide also describes using an API to authenticate when the application supports that route. Prefer an approved API or identity-provider flow when available; otherwise, perform the permitted sign-in in a controlled setup step and save the resulting state for the scheduled job. See the Playwright authentication guide and the BrowserContext API.

#1 Best Overall
Sale
Epson Workforce ES-50 Compact & Lightweight Mobile Document Scanner | For Computers including PC and Mac Receipt and Document Scanner USB Powered
  • PORTABLE SCANNER FOR USE ON-THE-GO — The fastest and lightest mobile single-sheet-fed compact document scanner in its class¹
  • QUICK DOCUMENT SCANNING ― This Epson ultra-fast scanner scans a single page as quickly as 5.5 seconds²; Windows and Mac compatible
  • VERSATILE PAPER HANDLING ― Portable scanner scans documents up to 8.5 x 72 in; Also easily digitizes receipts and ID cards to make accounting, bookkeeping, and organizing simpler
  • INTUITIVE, HIGH-SPEED SOFTWARE — Epson ScanSmart Software³ is a smart tool allowing you to easily scan, review, and save; Stay organized easily with the help of this Epson scanner
  • EASY SETUP — USB-powered connect to your computer for quick and simple scanning; No batteries or external power supply required to operate portable document scanner; Standard Connectivity: USB 2.0

A minimal pattern is to load an existing state file, navigate to the portal, check for a marker that only appears after sign-in, and take the screenshot only if that check passes:

import { chromium } from 'playwright';

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

try {
  await page.goto('https://portal.example.com/customer', { waitUntil: 'domcontentloaded' });
  await page.getByRole('heading', { name: 'Customer dashboard' }).waitFor({ timeout: 15000 });
  await page.screenshot({ path: 'artifacts/portal.png', fullPage: true });
} catch (error) {
  throw new Error(`Portal authentication or page check failed; screenshot not saved: ${error}`);
} finally {
  await browser.close();
}

Replace the example URL and heading with the portal address and a reliable authenticated-page marker. A dashboard heading, account navigation item, or other element unique to signed-in users is better than checking only that a page loaded. The example intentionally does not save a screenshot when that check fails.

For the initial setup, sign in through the approved flow in a controlled context, then save the authenticated state using Playwright’s documented setup pattern. Keep setup separate from routine capture runs so the scheduled job can fail clearly when the session expires rather than silently capturing a login screen.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Brother DS-640 Compact Mobile Document Scanner, (Model: DS640)
  • FAST SPEEDS - Scans color and black and white documents a blazing speed up to 16ppm (1). Color scanning won’t slow you down as the color scan speed is the same as the black and white scan speed.
  • ULTRA COMPACT – At less than 1 foot in length and only about 1. 5lbs in weight you can fit this device virtually anywhere (a bag, a purse, even a pocket).
  • READY WHENEVER YOU ARE – The DS-640 mobile scanner is powered via an included micro USB 3. 0 cable allowing you to use it even where there is no outlet available. Plug it into you PC or laptop and you are ready to scan.
  • WORKS YOUR WAY – Use the Brother free iPrint&Scan desktop app for scanning to multiple “Scan-to” destinations like PC, Network, cloud services, Email and OCR. (2) Supports Windows, Mac and Linux and TWAIN/WIA for PC/ICA for Mac/SANE drivers. (3)
  • OPTIMIZE IMAGES AND TEXT – Automatic color detection/adjustment, image rotation (PC only), bleed through prevention/background removal, text enhancement, color drop to enhance scans. Software suite includes document management and OCR software. (4)

Protect the saved state like a credential

Playwright warns: “The browser state file may contain sensitive cookies and headers that could be used to impersonate you or your test account.” A state file is not a password, but it can still provide account access. Restrict read access to the scheduled job and authorized maintainers.

  • Keep the auth-state directory out of version control, as Playwright recommends.
  • Do not put the file in screenshots, logs, or broadly accessible build artifacts.
  • Store it only where the scheduled runner can access it, with access limited to the job and the people who maintain it.
  • Remove or refresh it when the account’s access ends or the state expires.
  • Apply your organization’s privacy and access rules to screenshots, logs, and retained artifacts as well as to the state file.

Playwright’s documentation does not prescribe a particular secret store, screenshot destination, or retention period. Choose those according to your organization’s requirements.

Account for sessionStorage and other portal-specific behavior

Playwright’s standard storage-state workflow supports cookies and local storage; its current API reference also describes IndexedDB and other state. The authentication guide says Playwright does not provide a built-in API to persist sessionStorage, though it shows a custom-script approach to save and restore it. If the portal relies on sessionStorage, that additional handling may be necessary. Keep custom save-and-restore logic scoped to the relevant origin and protect the resulting data as sensitive. Do not assume cookies alone can reconstruct every login. See the authentication guide and BrowserContext API.

Rank #3
Sale
Epson Workforce ES-400 II High-Speed Color Duplex Desktop Document Scanner | For Computers including PC and Mac with Auto Document Feeder and Image Adjustment Tools
  • FAST DOCUMENT SCANNING — Document scanner with feeder allows you to speed through stacks with a 50-sheet Auto Document Feeder (ADF); Efficient office scanner to help you scan more productively
  • INTUITIVE, HIGH-SPEED SOFTWARE — Quickly scan with this desktop document scanner; Epson ScanSmart Software lets you easily preview scans, email files, upload to the cloud, and more; Plus, automatic file naming saves even more time
  • SEAMLESS INTEGRATION — Easily incorporate your data into most document management software with the included TWAIN driver; Office document scanner integrates seamlessly with business workflows
  • EASY SHARING — Duplex scanner allows you to scan straight to email or popular cloud storage2 services like Dropbox, Evernote, Google Drive, and OneDrive for simple storage and sharing
  • SIMPLE FILE MANAGEMENT — Scanner allows the creation of searchable PDFs with Optical Character Recognition (OCR) and convert scans to editable Word or Excel files effortlessly; Designed for home and office document scanning

Run the capture on a schedule and verify the result

A CI job, container, or another approved scheduled runner can launch the browser while your own device is off. Playwright documents running in CI and containers, and its Page API documents page.screenshot(). The scheduler, frequency, retention period, and destination are implementation choices rather than settings prescribed by Playwright. See Playwright CI and the Page API.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Make the scheduled runner start the browser in the environment your organization approves.
  2. Create a browser context using the saved state file.
  3. Navigate to the portal page and wait for a reliable authenticated-page marker.
  4. Save the screenshot only after that marker is present, and send failure details to a restricted log or alert channel without exposing session data.
  5. Write the image to an access-controlled destination and apply the retention period required by your organization.

If the page check finds a login screen, times out, or cannot find its expected marker, treat the run as failed. Do not retain that image as if it were a customer-portal capture. Arrange reauthentication through the approved flow, then update the stored state. How long a session remains valid and how it can be renewed depend on the portal and identity provider. Playwright notes that saved state may need to be deleted when it expires.

Keep visual comparisons consistent

When screenshots are used to compare changes over time, keep the browser and operating-system environment, viewport, and relevant rendering settings consistent. Playwright cautions that screenshots can vary with host operating system, browser version, settings, hardware, power source, and headless mode. Its CI guidance describes containers as a way to create a consistent environment; this does not guarantee identical output across all environments. See Playwright visual comparisons and Playwright CI.

Rank #4
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
  • Scanner type: Document
  • Connectivity technology: USB
  • With Auto Scan Mode, the scanner automatically detects what you're scanning
  • Digitize documents and images

Troubleshoot common failures

  • The job shows the login page: The saved state may have expired, the account may require interactive renewal, or the state may not include the mechanism the portal uses. Stop the capture, confirm the failure through the authenticated-page check, and refresh state using the approved sign-in flow.
  • The login works manually but not from saved state: Check whether the portal depends on sessionStorage or another state mechanism that the saved state does not preserve automatically. Follow Playwright’s documented sessionStorage workaround if applicable, scoped to the portal origin.
  • The page loads but the marker times out: Confirm that the marker is still present on the signed-in page and that navigation reached the intended destination. A login redirect or changed page layout should fail the run rather than produce a misleading screenshot.
  • The runner cannot read the state file: Check the scheduled job’s file path and permissions. Grant access only to the runner and authorized maintainers; do not solve this by publishing the file as a broadly accessible artifact.
  • Comparison images differ unexpectedly: Compare browser version, operating system, viewport, settings, hardware, and headless mode across runs. A container can help standardize the execution environment, but it does not promise pixel-identical results.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. For a public page that does not require portal authentication, one GET request can return an image or PDF; it does not replace the protected-state workflow above for a private portal. The example below captures the public Stripe homepage. See the ScreenshotNeo documentation for request options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses report page verdict and billing status in headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Frequently Asked Questions

Will saving browser state save my account password?

The workflow reuses authenticated browser state rather than re-entering the password for each capture, but the saved cookies or headers can still grant access and must be protected like a credential.

Best Value
Sale
ScanSnap iX2500 Wireless or USB High-Speed Document Scanner, Black | Cloud Enabled | Photos & Receipts | Large Touchscreen | 100 page Auto Document Feeder | Mac or PC
  • OUR MOST ADVANCED SCANSNAP. Large touchscreen, fast 45ppm double-sided scanning, 100-sheet document feeder, Wi-Fi and USB connectivity, automatic optimizations, and support for cloud services. Upgraded replacement for the discontinued iX1600
  • CUSTOMIZABLE. SHARABLE. Select personalized profiles from the touchscreen. Send to PC, Mac, mobile devices, and clouds. QUICK MENU lets you quickly scan-drag-drop to your favorite computer apps
  • STABLE WIRELESS OR USB CONNECTION. Built-in Wi-Fi 6 for the fastest and most secure scanning. Connect to smart devices or cloud services without a computer. USB-C connection also available
  • PHOTO AND DOCUMENT ORGANIZATION MADE EFFORTLESS. Easily manage, edit, and use scanned data from documents, receipts, photos, and business cards. Automatically optimize, name, and sort files
  • AVOIDS PAPER JAMS AND DAMAGE. Features a brake roller system to feed paper smoothly, a multi-feed sensor that detects pages stuck together, and skew detection to prevent paper damage and data loss

Does Playwright storageState preserve sessionStorage automatically?

No. Playwright’s authentication guide says it does not provide a built-in API to persist sessionStorage; a custom save-and-restore script may be needed if the portal depends on it.

Can ScreenshotNeo capture a private portal using my saved Playwright state?

The ScreenshotNeo details here describe a screenshot API and MCP server, not a way to load Playwright storageState for private-portal authentication. Use the approved authenticated-browser workflow for protected pages.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

authenticationbrowser automationcustomer portalsPlaywrightscreenshots

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.