[PHP] cookie paths are really confusing me...please help!

2001-01-21 Thread Noah Spitzer-Williams

ok here's what i get from php.net:

SetCookie()'s behavior is dependant on where it is called within the web
document tree. For example, setting a cookie from a php script in a
directory makes that cookie available only to other scripts in that
directory and its subdirectories. However, setting a cookie of the same name
from a script in the directory's parent directory will override all cookies
of that name in the parent directory's subdirectories.

scenario: im browsing a file in lets call directory 'test'. this file is
including a file in the parent directory. this included file is setting a
cookie.

the problem is when i goto directory 'test2' and use this same included file
in the parent directory, it cant find the cookie.

how should be setting this cookie??

- Noah



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] cookie paths are really confusing me...please help!

2001-01-21 Thread Jason Murray

 scenario: im browsing a file in lets call directory 'test'. 
 this file is including a file in the parent directory. this included 
 file is setting a cookie.

The point here is that the file is being *included*, therefore the
cookie will only be local to that "test" directory, regardless of
where the file that sets the cookie lives.

 the problem is when i goto directory 'test2' and use this 
 same included file in the parent directory, it cant find the 
 cookie.
 
 how should be setting this cookie??

I mainly set my cookies with a path of "/". Saves hassles, and the
cookie is accessible everywhere.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]