> ## Documentation Index
> Fetch the complete documentation index at: https://dokumentation.websale.de/llms.txt
> Use this file to discover all available pages before exploring further.

# Cookies

> How WEBSALE V8s detects browser cookie support and how to display a notice about cookie use in the shop.

Cookies are small text files that the visited website — for example, your WEBSALE shop — places on the computer or mobile device on which the website is displayed, via the browser. Among other things, they are used to pass on the SessionID of a shop visitor so that the shop can assign all clicks and actions during the ordering process to the respective customer. Cookies are also needed for statistics and tracking purposes as well as for connecting to partner programs.

This page covers two topics. First, cookie detection — that is, determining whether a visitor's browser supports cookies at all. Second, displaying a notice about the use of cookies in the online shop.

> [!NOTE]
>
> For a GDPR-compliant integration with which you can obtain the shop visitor's consent to the processing of personal data, see Guide: Consent to data processing (cookies).&#x20;

## Overview of the cookies used

An overview of the cookies used in a WEBSALE online shop can be found under Materials: Cookies used.&#x20;

## Cookie Detection

Two methods are available for determining whether the browser supports cookies. The JavaScript method is the default; the redirect method is the older variant and only makes sense for exceptional cases. Following both methods, you will find an example of a notice for customers whose browser does not accept cookies.

### Integrating cookie detection with JavaScript (default)

When this detection method is used, WEBSALE V8s sends the first shop page called up at the beginning of the session with a JavaScript that is automatically inserted into the HTML code. This script checks whether the browser supports cookies — in other words, it performs what is known as cookie detection.

You use this detection method if the `CookieDetectionMethod` parameter in the `<Basic>` section of your shop configuration `shop.config` is set to `javascript`. The JavaScript detection method is the default. It avoids the older redirect method described below, which only makes sense in exceptional cases.

```ini theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<Basic>
   ...
   CookieDetectionMethod   = javascript
   ...
</Basic>
```

Reference: Basic section&#x20;

### Integrating cookie detection with redirect

WEBSALE V8s performs a redirect call of the shop and uses it to check whether the browser supports cookies.

This redirect is executed automatically by the shop if the `CookieDetectionMethod` parameter in the `<Basic>` section of your shop configuration `shop.config` is set to `redirect`.

In this case, the parameter `?cc=y` appears in the URL.

#### Adjusting the shop configuration

If necessary, the redirect method must be activated in your shop configuration `shop.config` in the `<Basic>` section by switching the `CookieDetectionMethod` parameter from `javascript` to `redirect`.

```ini theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<Basic>
   ...
   CookieDetectionMethod   = redirect
   ...
</Basic>
```

Reference: Basic section&#x20;

### Provide a notice for buyers who do not accept cookies

If a customer's browser does not accept cookies, we recommend integrating a notice. This lets you specifically inform the customer that placing an order in your online shop is not possible without accepting cookies for security reasons.

Example:

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<body>

...

   {!WS-CookiesEnabled}
     {!WS-FirstCall}

      To improve the security of your personal data during transmission,
      we use secure cookies.

      Please make sure that your browser accepts cookies.

      Unfortunately, it is not possible to place an order without cookies, as we cannot
      guarantee the security of your data in that case.

      What cookies are, what they are used for, and how you can enable and manage cookies
      is explained on the websites of the respective providers.

      <a href="https://support.mozilla.org/de/kb/cookies-informationen-websites-auf-ihrem-computer">
         Mozilla Firefox</a>

      <a href="https://support.google.com/chrome/answer/95647?co=GENIE.Platform%3DDesktop&hl=de">
         Google Chrome</a>

      <a href="https://support.microsoft.com/de-de/help/17442/windows-internet-explorer-delete-manage-cookies">
         Internet Explorer</a>

     {/!WS-FirstCall}
   {/!WS-CookiesEnabled}

...

</body>
```

Reference: WS-CookiesEnabled&#x20;

Reference: WS-FirstCall&#x20;

## Displaying a cookie notice

> [!WARNING]
>
> This notice is no longer GDPR-compliant.
>
> The notice is merely information that cookies are used in the shop. According to current case law, this notice alone is not sufficient. Even if the user does not click "OK", cookies will generally be set, provided the customer's browser supports them. If the customer clicks "OK", an additional cookie is set that prevents this notice from being shown on later visits to the site.
>
> For a GDPR-compliant integration with which you can obtain the shop visitor's consent to the processing of personal data, see Guide: Consent to data processing (cookies).&#x20;

![Cookie Zustimmung](https://mintcdn.com/websaleag-44ee7ea6/skgEiyBpkjLxNR4u/images/cookie_zustimmung.png?fit=max\&auto=format\&n=skgEiyBpkjLxNR4u\&q=85\&s=f0b2e8b9210e7de824d1f06ccbbf4fa5)

### Step 1: Activation by WEBSALE

No activation by WEBSALE is required to embed the cookie notice.

### Step 2: Embed the WEBSALE system library

Check whether this file is already embedded and, if necessary, add it in the `<head>` section of the desired pages.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<script type="text/javascript" src="/$WS/ws_sysdata/js/ws-system-1.8.3.js"></script>
```

### Step 3: Embed the script

Embed the script for displaying the notice in the `<head>` section of the desired pages:

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<script type="text/javascript" language="JavaScript" src="/<your directory>/ws-cookie-layer-1.0.0.js"></script>
```

WEBSALE provides you with a template script; see Materials: Script for cookie notice.&#x20;

### Step 4: Integrate the function call

Integrate the following function call in the HTML header of the desired pages.

Example:

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<script type="text/javascript">
$(document).ready(function() {
    //Selector = ID of the layer block
    $("#ws_cookie_layer").ws_cookie_layer({
        shopId: "~WS-ShopID~",
        subshopId: "~WS-SubShopID~",
        cookiePrefix: "ws_cookie_layer",
        cookieDuration: 90,
        buttonSelector: "#ws_cookie_layer_button"
    });
});
</script>
```

The parameters used have the following meaning:

| Parameter | Meaning |
| - | - |
| `shopId` | ShopID |
| `subshopId` | SubShopID |
| `cookiePrefix` | ID of the layer |
| `cookieDuration` | Lifetime of the cookie in days |
| `buttonSelector` | ID of the button for consent |

### Step 5: Place the layer in the template

Add the layer for displaying the notice in the template.

Example:

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
...
<div id="ws_cookie_layer">
    We and our partners use cookies to provide our services and to show you advertising based on your
    interests. By using our online shop, you agree to the use of cookies.
    <div id="ws_cookie_layer_button">OK</div>
</div>
...
```

The layer should be hidden at first, since otherwise, if the cookie is already set, the layer might be shown briefly. To do this, assign the layer the rule `display:none` in your CSS file:

```css theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
#ws_cookie_layer {
    display:none;
}
```

This way, the layer is only shown once the system has determined that cookies have not yet been enabled.


## Related topics

- [Cookies used](https://dokumentation.websale.de/en/v8s/referenz/verwendete-cookies.md)
- [AC- (AgreementCookies)](https://dokumentation.websale.de/en/v8s/referenz/tags/ac-agreementcookies.md)
- [Consent to data processing (cookies)](https://dokumentation.websale.de/en/v8s/einstellungen/einwilligung-zur-datenverarbeitung-cookies.md)
- [$wsCookie - Browser cookies](https://dokumentation.websale.de/en/frontend/referenz/module/ws-cookie-browser-cookie.md)
- [$wsConsent - Cookies & Services](https://dokumentation.websale.de/en/frontend/referenz/module/wsconsent.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.