# Using Cookies

# Formatting cookies for Token API.

You may optionally provide cookies for the Token API to use for solving the challenge.

The cookie parameter should be provided as a Array of Dict .

This guide shows you how to format this value.


Parameter Type Required Description
name String Required The name of the cookie.
value String Required The value of the cookie.
domain String Required The domain of the cookie (e.g. "www.google.com", "example.com").
path String Required The path of the cookie.
hostOnly Boolean Required True if the cookie is a host-only cookie (i.e. a request's host must exactly match the domain of the cookie).
httpOnly Boolean Required True if the cookie is marked as HttpOnly (i.e. the cookie is inaccessible to client-side scripts).
secure Boolean Required True if the cookie is marked as Secure (i.e. its scope is limited to secure channels, typically HTTPS).
session Boolean Required True if the cookie is a session cookie, as opposed to a persistent cookie with an expiration date.
expirationDate Number Optional The expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies.
{
    'key': 'MY_NOPECHA_KEY',
    'type': 'hcaptcha',
    'sitekey': 'b4c45857-0e23-48e6-9017-e28fff99ffb2',
    'url': 'https://nopecha.com/demo/hcaptcha#easy',
    'cookie': [
        {
            'name': 'nopechacookie0',
            'value': 'hello world!',
            'domain': 'nopecha.com',
            'path': '/demo/hcaptcha',
            'hostOnly': true,
            'httpOnly': true,
            'secure': true,
            'session': false,
            'expirationDate': 1670023021
        },
        {
            'name': 'foo',
            'value': 'bar',
            'domain': 'www.nopecha.com',
            'path': '/',
            'hostOnly': false,
            'httpOnly': false,
            'secure': false,
            'session': true
        }
    ]
}

|||