> There is something i'm not sure about. As i understand, You only need to
> set a cookie, you dont need to get it. All you need to do is check if it
> exists.
Just like you don't need to get variables that come via a form submit, for
example.
> What i want to know is does php actually read all of the cookies on the
> client side and assigns them as global vars? how does it know to call
> "MyCookie"?
PHP doesn't go and get anything. The web browser sends the cookie when
appropriate. Each cookie has a host associated with it. It can
optionally also have a path, and if it isn't a session cookie it will have
an expire time. If these various things check out, then the web browser
sends the cookie as part of the request header in a header called,
"Cookie" (strangely enough). PHP takes this header and parses it and
pulls out the various cookie names and turns them into variables. So, if
you did a SetCookie("MyCookie","Boaz Yahav"); then PHP will automatically
create a variable called $MyCookie with a value of "Boaz Yahav" whenever
the web browser decides it should send this cookie as part of its request.
> What if i dont put a directory and dont put a domain in the setcookie?
Well, you can't not put a domain. There is no option to put the domain
there. The browser will automatically associate the cookie with the
domain it is set from. If you don't put a path the cookie will be sent to
all pages on that domain.