Planting Cookies From Website With Javascript?

I

inVINCable

Hello,

Ok, Sort of a basic question here but I cannot seem to find the info
anywhere... I am trying to connect to a site via javascript and that
site I am connecting to plants a few cookies. Now I know in javascript
you can name cookies and all of that stuff but I want to let the site
I am connecting to handle all of that like it normally would when you
visit a site with your browser. My ajax code is as follows:

var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
html = new ActiveXObject("Microsoft.XMLHTTP");
}else{
html = new XMLHttpRequest();
}
http = new XMLHttpRequest();
http.open(\"get\", \"'.$url.'\");
http.send(null);


Ok, so the ajax is working just fine using FireBug I can see the
request, and the response header location is the URL which I am
pinging. Is there a way to automatically take the cookies from the
response header location that would be planted when you visit the site
and do it through ajax?

Thank you again for any help/advice.

Regards
 
L

Logos

inVINCable wrote:
Hello,

Ok, Sort of a basic question here but I cannot seem to find the info
anywhere... I am trying to connect to a site via javascript and that
site I am connecting to plants a few cookies. Now I know in javascript
you can name cookies and all of that stuff but I want to let the site
I am connecting to handle all of that like it normally would when you
visit a site with your browser. My ajax code is as follows:

var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
html = new ActiveXObject("Microsoft.XMLHTTP");
}else{
html = new XMLHttpRequest();
}
http = new XMLHttpRequest();
http.open(\"get\", \"'.$url.'\");
http.send(null);

Ok, so the ajax is working just fine using FireBug I can see the
request, and the response header location is the URL which I am
pinging. Is there a way to automatically take the cookies from the
response header location that would be planted when you visit the site
and do it through ajax?

Thank you again for any help/advice.

Regards

If your question is "Can I write cookies to a domain other than the
one my page is being served from", then the answer is no. Browser
security does not allow it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top