Skip to main content

Get Cookie

Sophie avatar
Written by Sophie
Updated over 2 weeks ago

Definition and Usage

This command retrieves cookies from a specified web page or a specific URL in a browser. This command allows you to extract cookie information that can be used for session management, authentication, or data analysis in web automation workflows.


Parameter Values

Input parameters

Parameter

Description

Possible Values

Required

Options / Notes

Get cookie from

Specify how to get the cookie

Web page, URL

Yes

Select whether to get cookies from an open web page or a specific URL

Web page

Select a variable that contains the web page to work with

-

Yes (if "Web page" is selected)

Must be a valid web page variable

Browser

Select a browser type to operate on

Built-in browser, Google Chrome, Microsoft Edge, 360 Secure Browser, AdsPower, BitBrowser, SuperBrowser

Yes

-

Cookie URL

Match browser cookies based on the given URL

-

Yes (if "URL" is selected)

Must be a valid URL format

Store cookies into

Store the retrieved cookies into a new list variable

-

Yes

Output variable that will contain the cookie data

Advanced settings

Parameter

Description

Possible Values

Required

Options / Notes

Filter by name

Filter cookies based on whether they match the given name

-

No

Name filters are ignored if the value is empty

Filter by domain

Filter cookies based on whether they match the given domain

-

No

Domain filters are ignored if the value is empty

Filter by path

Filter cookies based on whether they match the given path

-

No

Path filters are ignored if the value is empty

Filter by Secure

Select secure filter

All cookies, Secure cookies, Unsecure cookies

No

Default is "All cookies"

Filter by Session

Select session filter

All cookies, Session cookies, Non-session cookies

No

Default is "All cookies"

Error handling

Parameter Name

Description

Throw error & stop

When an error occurs, the action will trigger an error and stop the execution of the entire app.

Retry command

If an error occurs, the action will retry the command in an attempt to resolve the issue and continue the process.

Ignore error & continue

When an error occurs, the action will be ignored, and the workflow will continue without interruption.

Variables produced

This action produces a list variable containing cookie information from the specified web page or URL. The output includes details such as cookie name, value, domain, path, expiration, and security settings.


Using Variables in Conditions

When you see a field with {x} icon, you can insert variables that were previously defined in your workflow. For example, you can use a variable for the "Cookie URL" field if you have a dynamic URL stored in a variable. This flexibility allows you to create more dynamic and reusable automation workflows.


Notes

  • Before using this command, ensure that the browser is properly initialized and, if using the "Web page" option, that a valid web page is open.

  • Some websites may have security measures that restrict cookie access, particularly for third-party cookies.

  • The retrieved cookies are returned as a list, where each item represents a cookie with its properties.

  • Advanced filtering options help narrow down the cookie retrieval to specific criteria, which is useful when working with websites that use many cookies.

  • Browser automation may be affected by browser security settings and cookie policies.

Did this answer your question?