Cookie Parser
AI-generatedOverview
The Cookie Parser node is designed to extract and parse a cookie string from incoming data, converting it into an object where each cookie name maps to its value. This is useful in workflows where you need to process HTTP request headers or responses that contain cookies, such as extracting session tokens, user preferences, or tracking information for further automation steps.
Practical examples:
- Extracting authentication tokens from HTTP request cookies.
- Parsing user preference cookies for personalization workflows.
- Processing analytics or tracking cookies for reporting.
Properties
| Name | Meaning |
|---|---|
| Cookie String | The path (dot notation) to the property in the input JSON that contains the cookie string (e.g., headers.cookie). |
Output
The node outputs an array of objects with the following structure:
[
{
"json": {
"cookieName1": "cookieValue1",
"cookieName2": "cookieValue2",
"...": "..."
}
}
]
Each key in the output object corresponds to a cookie name, and its value is the associated cookie value extracted from the input string.
Dependencies
- No external services or API keys are required.
- No special n8n configuration or environment variables are needed.
Troubleshooting
Common issues:
- Incorrect Cookie String Path: If the specified path in "Cookie String" does not exist in the input data, the node will not output any parsed cookies.
- Malformed Cookie String: If the cookie string is not properly formatted (missing
=or;delimiters), some cookies may not be parsed correctly.
Error messages:
- The node does not throw explicit error messages but may return empty results if the input path is incorrect or the cookie string is missing.
How to resolve:
- Double-check the "Cookie String" property to ensure it matches the actual path in your input data (e.g.,
headers.cookie). - Ensure the cookie string follows the standard format:
key1=value1; key2=value2.