Multi-language sites and cookies

Hi all,

According to Kirby Session Cookie & No CMS Session Cookie, a multi-language Kirby site will set a session cookie.

May I ask why? I understood that language detection works by interpreting request headers, and preserving the current language choice works via URL (see https://getkirby.com/docs/guide/languages/introduction#language-specific-urls).

What did I miss?

Thank you
Sascha

The page you linked to refer to Kirby 2.

You can read everything about Kirby and privacy here: https://getkirby.com/docs/guide/kirby-and-privacy

As you can see, a session cookie is only used if you enable the languages.detect feature that is disabled by default.

@texnixe exactly the document you were mentioning points out that the language feature uses a cookie. I also transferred that information into my privacy policy but just recently a friend pointed out that the cookie is actually not set for language (tests show that it only exists on browsers which have been on the panel):

Let’s be clear: Not the multi-language feature as such sets a cookie, but the languages detect feature that you can enable with

return [
  'languages.detect' => true
];
1 Like

Right, got me :wink: I was too quick and not precise enough in reading here…

Well done :slight_smile:

My question tho was: Why does the language detect feature set a cookie?

I’d say, so that the next time you visit the site, the detected language is remembered. Language detection only works on the home page.