Forum Moderators: open

Message Too Old, No Replies

cookie question

         

scorpion

7:39 pm on Jan 24, 2003 (gmt 0)

10+ Year Member



If a cookie set on DOMAIN_A (.domaina.com) then can you do a cookie check under DOMAIN_A/anotherdir/, that is a file in anotherdir/ can check if a cookie is set (for example, using PHP, (isset($acookie)) where acookie was set for the toplevel domain somewhere else...

Thanks

jatar_k

7:44 pm on Jan 24, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I believe it is one cookie per domain. I think you will run into trouble with more than one one.

You can always read the cookie and then add new data to it.

lazerzubb

7:44 pm on Jan 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



[EDIT]Better answer above, i think you will have to set the cookie under the same domain, also check if you are better off with Sessions (even though they might take a big server load, deppending on size, and how many)[/EDIT]

msr986

8:00 pm on Jan 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



scorpion,

You can set a cookie from anywhere on the domain, and read it anywhere on the domain; but it must be the same domain. Cookies will work across sub-directories, but do not work across sub-domains.

-Marty