Yes. That would be good to improve the no cookie way of working. However, I would do the test before in the process. In include/core.php
, line 399, replace:
$this->curlang = $this->options['hide_default'] && (isset($_COOKIE['wordpress_polylang']) || isset($_COOKIE[PLL_COOKIE])) ?
$this->get_language($this->options['default_lang']) :
$this->get_preferred_language(); // sets the language according to browser preference or default language
by:
$this->curlang = $this->options['hide_default'] && ((isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], $this->home) !== false) || isset($_COOKIE['wordpress_polylang']) || isset($_COOKIE[PLL_COOKIE])) ?
$this->get_language($this->options['default_lang']) :
$this->get_preferred_language(); // sets the language according to browser preference or default language