Cookies or LocalStorage for Language selection using subdomains

Hello community! I am trying to make a selection of the country on the site and then switch to another subdomain. I used to save the selection to Local Storage, as in this tutorial from Finsweet:
Works well, but I ran into it not working between subdomains. Tell me how you can make the same choice appear after switching to a subdomain?

Here is the link to page:

And here is the read-only link: