No ruturajv, i think he's not even using php... am i right w-h !?
Well, if both sites have a different IP address, it could be 'impossible'!
Here's is a simple explanation why: Cookie's Path
Just a note
: The cookies
functionality is always the same, don´t matter what scripting laguage you're using!
If you're using PHP/MySQL you can do what ruturajv said!