There is a technique that multi-site companies like google employ to keep their users logged in for all their sites per single authentication.
This question is about how A can read a cookie of B. But my answer only tells you how A can set a cookie in B. Although this technique can be employed in a useful way for OPs favor, negative points are welcome. I will still spread the awareness.
Create a php file (lets say setcookie.php) in site B. This can set a cookie for site B.
setcookie("MyCookie", "subinsb.com", time()+3600);
Now if you can call this php file from any site, it will set the cookie for site B. A famous way to call this script is via a hidden img
tag. So, the site A can have this image tag - which will set a cookie for site B.
<img src="http://www.siteB.com/setcookie.php" style="display:none;" />
When this image is loaded, you know the cookie for site B is set.
Interestingly, you can send data too to the cookie of site B through the URL. Your setcookie.php
can read data via $_GET
and include them in the cookie.
Here is the article.