I am developing a Crossrider extension to log info from web pages. When the user clicks the extension button it fires a popUp and in that code I am using appAPI.request.get() to call a php page from my myDomain.com that reads and then sets a cookie value for myDomain.com. This works in IE, Chrome, Safari and Firefox, except on my MacBook Safari isn't able to set the cookie. I am running the exact same version of OSX and Safari on my iMac and it works fine. I've double checked that both prefs are the same and they are.
Is this a possible cross domain restriction? Since the remote page is being called via js in the popUp does that restrict it's ability to set cookies for the domain it resides on (myDomain.com)?
edit 2014-05-22
/* background.js */
appAPI.browserAction.setPopup({
resourcePath:'index.html',
height: 380,
width: 320
});
...
/* index.html */
appAPI.request.get({
url: 'https://example-domain.com/this-file-sets-a-cookie.php',
....
});
This was an issue of Safari blocking the cookie. It appears that in some instances the cookie is being seen as being set by a third party and thus refused. Possibly because the address bar shows a different URL than the cookie is being set to, even though the domain from which the cookie is being set and the domain specified for the cookie are the same. I was able to get the cookie to set when I changed privacy settings to "Never" refuse cookies. Why it worked on one machine and not the other when both were running the same OS version, the same Safari version and both were set to refuse cookies from 'From third parties and advertisers" is unknown.
Luckily I was able to remove my php code that was setting a cookie without affecting my plugin.