I have multi-language functionality on my page, and the settings are saved in a cookie, so that the user may change something different than his browser language.

But this is whats happening:

The page shows it's text in English, and prints my user info aswell as the content of the language cookie, which is "en".

The page shows in my browser language. Meaning the set language from /home.php haven't persisted.

The page still shows in English.

So basically as I navigate around my site, as soon as the page is in another dir, the cookie is unique for that dir.

Hope this explanation is possible to understand.

So, why does this happen? I thought cookies were domain specific?
How do I solve this? Links are fine.

Edited by Excizted: n/a

7 Years
Discussion Span
Last Post by Excizted

Reading the documentation works for me! From the PHP manual:

The path on the server in which the cookie will be available on. If set to '/', the cookie will be available within the entire domain . If set to '/foo/', the cookie will only be available within the /foo/ directory and all sub-directories such as /foo/bar/ of domain . The default value is the current directory that the cookie is being set in.


Ahh haha, you got me there, silly me ;)
I thought it would be some server configuration or something.

Well thank you very much! :D

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.