Note: setting cookies to identify a user as 'logged in' is extremely unsecure.
Anybody who listens to your connection can find the cookie and pretend to be you.
The cookie method is only 'secure' if your script also checks to see if the request (including the cookie) came from the same IP address that the original logon-request came from.
Problem: the second site will not who which IP you used to logon to the first website.
You could solve this by making it so that when you log on to the first site, the site itself sends the logon details to the second server (using a trusted/encrypted connection) so the second server knows who is logged on to the first server. (and vice versa) A kind of replication.