# Cookie

{% hint style="info" %}
By default, an affiliate code is stored in the user's session. If this configuration is activated, the code can also be stored in a cookie for a longer period of time.
{% endhint %}

#### Save affiliate code in cookie

If this configuration is active, the affiliate code is stored in a separate cookie to extend its lifetime, in addition to the session. The name of the cookie is "cogi-affiliate-code" - it requires an additional cookie called "cogi-affiliate-allowed", which remembers whether the cookie was allowed in Shopware's Consent Manager. This enables the use of affiliate cookies in compliance with data protection regulations.

#### Ignore setting in Consent Manager

Once this configuration is activated, the cookie is always set regardless of the setting in the Consent Manager (not recommended!).\
This can be useful if you use your own Consent Manager.

#### Overwrite existing affiliate cookies

If an affiliate cookie has already been set, the respective cookie should be overwritten when the affiliate link is called up again. This allows you to control which affiliate is prioritized for the calculation of provisions.

#### Cookie lifetime

This configuration allows you to define the lifetime of the affiliate cookie in days. By default, a cookie remains set for 30 days, if activated. This refers to the "cogi-affiliate-code" cookie - the "cogi-affiliate-allowed" cookie for data protection compliance is not affected by this.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.codegiganten.de/plugin-documentation/en/apps/affiliate-marketing/configuration/cookie.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
