Hi All, I want to set cookie for domains like x.com from my local host. Is it possible if it is so how can I do it
You cannot, of course. It would be a massive security problem if one site could manipulate cookies for another site.
Most common is through ajax/js. The request is to the 2nd domain so that 2nd domains cookies are in play, and the call returns json or js vars with data. You can only see and set the cookie for the domain of the request. You can't overwrite or read another domains cookies.
Look at the source for those pages and you will see they all request something (image, script, etc.) from the same domain.