StrikekitStrikekit

set cookie

Set a browser cookie scoped to the current page URL

Set a cookie on the browser context, scoped to the URL of the current page. Navigate first so the cookie has a page URL to attach to.

Syntax

When I set cookie "<name>" to "<value>"

Qualifiers

QualifierRoleExample
toCookie valueset cookie "session" to "abc"

Requirements

ItemContract
Element / control shapeNone — browser cookie on current page URL scope
How the label bindsName + value payloads
Qualifiers that change resolveto
PlatformWeb only (requires a loaded page)
Wrong shape → use insteadlocalStorage → set local storage

See also UI contracts.

Examples

Given I navigate to "https://example.com"
When I set cookie "session" to "abc123"

Notes

  • Quoted values resolve like every other step ($ENV, @ / @@, {{faker}}). Reports keep the raw .stk quote.
  • Useful to skip login flows when you already have a session cookie.
  • Web only. Appium / Platform: api return unsupported.

On this page