<?php
setcookie("myCookie", 1, time() +50);
echo $myCookie."<br>";
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>crossDomainCookie</title>
</head>
<body>
<a href="http://dot.kr/x-test/crossDomainCookie.php">dot.kr</a><br>
<a href="http://www.dot.kr/x-test/crossDomainCookie.php">[COLOR="Red"]www[/COLOR].dot.kr</a><br>
<a href="http://subDomain2.dot.kr/x-test/crossDomainCookie.php">[COLOR="red"]subDomain2[/COLOR].dot.kr</a><br>
<a href="http://term.kr/x-test/crossDomainCookie.php">[COLOR="Red"]term[/COLOR].kr</a><br>
</body>
</html>
The 4 links in the code above opens a same file.
But the cookie value doesn’t show when it clicks the link crossing the domain.
Is there anyway for making the cookie( or session or other global variables ) to work cross domain?
You can test it in http://dot.kr/x-test/crossDomainCookie.php