Jump to content

A Question About Cookies


.Darkman

Recommended Posts

Hello,

 

I've got a question about cookies...

 

Are the cookies accessible only from the site that places it ?

 

For eg, if i use this code on abc.com :

setcookie("darkman", "some message", 3600);

 

And, have this on xyz.com :

echo $_COOKIE['darkman'];

 

Will it display "some message" on xyz.com ?

 

Thanks,

 

Link to comment
https://forums.phpfreaks.com/topic/134634-a-question-about-cookies/
Share on other sites

how did you create it?

 

if you don't supply a PATH (argument #4), it will default to the current directory. your setcookie should look like:

setcookie('cookie_name','foobar',0,'/');

 

p.s. - the 0 means the cookie will expire at the end of the session. you may want to alter that to your needs

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.