I have two sites – both are my projects. On site two, I need to check if the user is logged in on site one. I suppose to do this I should just create a script that puts a cookie into the body of an iframe and then read the iframe contents on site two. But I can’t.
Here is a code I made for testing purposes:
http://jsbin.com/oqaza/edit
I got an error, that says:
“Permission denied for
<http://jsbin.com> to get property
HTMLDocument.nodeType from
<http://www.google.com>.”
I finally got it. Generally there is solution like “OpenID” (used even here on SO), but I discovered, that JSONP is easiest way to read cookies across domain 🙂