A question originally posted on webmasters was recommended to move it here.
I host a web service and provide my members with a Javascript bookmarklet that downloads the JS script from my server. However, clients must be logged in to receive a JS script. It works for almost everyone. However, some users in the settings (for example, the browser / OS) that are known to work for other people have the following problem: when they request a script through the javascript bookmarklet from my server, their cookie from my server is not included in the request, and therefore, they are always “not authenticated”.
I am making a request as follows:
var myScript = eltCreate('script');
myScript.setAttribute('src','http://myserver.com/script');
document.body.appendChild(myScript);
In a fit of vague despair, I changed the script page to just output "My cookie has [x] elements," where [x] is count($_COOKIE)on http://myserver.example.com. If this subset of users requests a script using the bookmarked method described above, the message reads: "My cookie contains 0 elements." When they access the URL directly in their browser, the message reads: "My cookie has 7 elements."
What can happen?! And more importantly, how would I fix this?
source
share