How to avoid cross-reading between different directories under the same domain?
For example,
setcookie('username', $username, strtotime('+1 months'), '/jp/', '.localdomain.com');
setcookie('username', $username, strtotime('+1 months'), '/cn/', '.localdomain.com');
When I use $_COOKIE['username'] to read the value under
/jp/
or
/cn/
respectively?
I am using PHP.
To maintain a number of different sessions on the same domain, you need to adjust your session cookie parameters. It’s like the cookie parameters but specifically for the session cookie.