Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 10:00 8:00 – 10:00 8:00 – 13:00 8:00 – 13:00 9:00 – 13:00 -
- 11:00 – 17:00 11:00 – 17:00 14:00 – 17:00 13:00 – 17:00 13:00 – 18:00 -

Supporter timezone: America/New_York (GMT-05:00)

This topic contains 2 replies, has 2 voices.

Last updated by matthiasT-4 1 year, 11 months ago.

Assigned support staff: Lauren.

Author Posts
December 10, 2020 at 5:52 pm #7637877

matthiasT-4

Remember visitors' language preference for 24 hours is not working. If you open the site again right after closing the browser, it automatically loads the default language. This is happening with browser redirect enabled or disabled.

December 10, 2020 at 6:51 pm #7638245

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

After discussing further with our developers, it seems the wording on the languages page is unclear. The redirect is only meant to happen every 24 hours by default. So it's not that the site remembers the users language for that 24 hours, it's that you can change that option to not reset every 24 hours. I confirmed this because when you close the browser or start a new session, it redirects correctly. So if you were to visit the site 24 hours after you left the site, the redirect would happen 1 time again. I'm going to contact our documentation team to clarify the wording on the WPML -> Languages section. This documentation may help clarify: https://wpml.org/documentation/getting-started-guide/language-setup/automatic-redirect-based-on-browser-language/#no-redirection-when-refreshing-the-browser

December 23, 2020 at 10:11 am #7722267

matthiasT-4

Hey Lauren,

thank you for your reply. Unfortunately, we don't experience the functionality that you are describing on our side.
Here is our situation again: The site we are using automatic language redirection for is a hotel website. The hotel is located in Austria (language: german) but we have a lot of non-german speaking guests from e.g. the Netherlands.
The default language of the page is set to English in order to provide the english page for the majority of our guests. However, if a german-speaking person visits the website, he should be redirected to the german version of the page. So far so good.

You wrote:
> I confirmed this because when you close the browser or start a new session, it redirects correctly.

That is not happening for us. Our browser language is set to German. If I access the site the first time it redirects me to the german page, which is fine. As soon as I start a new session or close the browser, the redirect does not work anymore. This means, that a german-speaking person only sees the german site in 1 session every 24h. I can't seem to get my head around the fact that this is the intended behavior. Please check out this screen recording: hidden link

The redirect in a new session is only working (once) after clearing my cache, the cookies and the browser data in the browser settings.

Are you able to reproduce our issue on your end as well?
Feel free to test it at hidden link

One of our guesses is, that the cookie that is stored by WPML is not interpreted correctly in our case, because the site is loading in English in a second, new session, although the _icl_visitor_lang_js stored that the language I prefer is german. Also, the Domain in the stored cookie has a dot "." at the beginning, maybe that affects it? The other WPML cookie does not have this . in front of www.
Here is a screenshot of the cookie data: hidden link

Thanks for your help.