Can a parameter of path be added to $_COOKIE[]?
views:
346answers:
4yes, it's the 4th argument, but you will only be able to access the cookie if it was set using a path that the current directory resides in.
that's confusing... here it is from php:
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.
http://php.net/manual/en/function.setcookie.php
You access it like any other cookie. It will become available in $_COOKIE if the script has access to it.
In case you are trying to access cookies set for a different path on the same domain than the current, that can't be done. The browser itself restricts this, and only sends the cookies appropriate for the current path.
No, such parameters are impossible because the browser does not send the path to the server. It does only send the name and the value of each cookie (so you can't see the path, if it's a session cookie, when it will expires and so on).
I don't think it will be possible to get the cookie from a different path, since it could possibly cause a security issue.