Cookies

S

Simon B. Nielsen

Is it possible for me to set a cookie from MyDomain1.com and then read that
same cookie from MyDomain2.com?
 
M

Martin Honnen

Simon said:
Is it possible for me to set a cookie from MyDomain1.com and then read that
same cookie from MyDomain2.com?

No, you can set a cookie from host1.domain.tld with
document.cookie = 'cokieName=' + escape(cookieValue) +
'; domain=domain.tld'
and then read it from host2.domain.tld
 
R

rf

Simon B. Nielsen said:
Is it possible for me to set a cookie from MyDomain1.com and then read that
same cookie from MyDomain2.com?

Not unless you change the security settings in your browser. You can't do it
on my system.

Cheers
Richard.
 
R

Randell D.

Simon B. Nielsen said:
Is it possible for me to set a cookie from MyDomain1.com and then read that
same cookie from MyDomain2.com?
From MyDomain1.com, set a cookie for MyDomain2.com - I believe you can
write, but not read to someone else's domain name... thus by having a script
executed from MyDomain1.com and planting it at MyDomain2.com - you should
then be able to use code on MyDomain2.com to read MyDomain2.com cookies...

I'm not certain of this, but believe the 'rule' to be that you have no read
access to another domains cookies - I don't believe there is a problem to
createing a cookie for a domain any domain.
 

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
474,100
Messages
2,570,635
Members
47,243
Latest member
RustyPalin

Latest Threads

Top