I am developing a bookmarklet that helps users share images. While authenticating the person, I need to read cookie set by domain: www.xxx.com.
The bookmarklet JavaScript is served by bookmarklet.xxx.com but since this JavaScript is rendered on the website on which bookmarklet is called, it only accessed the cookies of that site and not the ones set by www.xxx.com.
I have researched it and according to some answers at SO, this is a security issue and hence cookies from another domain can't be accessed.
I tried executing my scripts in a hidden iframe rendered by www.xxx.com/iframe/iframe.html and it did accessed the cookies but the problem is this script can't pass the value to my bookmarklet script. And I can't access the Iframe DOM which is another security issue.
Kindly suggest a suitable way so that I may solve this issue.