473,473 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Reading Cookie from a different domain?

Hi all,

Can javascript read a cookie from a different domain? Meaning, if my
html page is running on "www.mydomain.com" and I goto another domain
"www.another.com" to do some work, and then I come back, can I see the
cookie that "www.another.com" created from my domain???

Any thoughts?

~Kam (^8*
Jul 20 '05 #1
3 45123
Hi,

kam bansal wrote:
Hi all,

Can javascript read a cookie from a different domain? Meaning, if my
html page is running on "www.mydomain.com" and I goto another domain
"www.another.com" to do some work, and then I come back, can I see the
cookie that "www.another.com" created from my domain???

Any thoughts?

~Kam (^8*


No, that would be a big security breach.

The only thing you can do to transmit information between
www.another.com and www.mydomain.com is call the URL with parameters,
for example:

www.mydomain.com?param1=value1&param2=value2

Laurent
--
Laurent Bugnion, GalaSoft
Webdesign, Java, javascript: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch

Jul 20 '05 #2
I could swear that there is a way to do this. You can share cookies with
your other sites in some way (seems to me it involved using IP addresses
instead of domains.) Not really recommended though.

"Laurent Bugnion, GalaSoft" <galasoft-LB@bluewin_NO_SPAM.ch> wrote in
message news:3f**********@news.bluewin.ch...
| Hi,
|
| kam bansal wrote:
| > Hi all,
| >
| > Can javascript read a cookie from a different domain? Meaning, if my
| > html page is running on "www.mydomain.com" and I goto another domain
| > "www.another.com" to do some work, and then I come back, can I see the
| > cookie that "www.another.com" created from my domain???
| >
| > Any thoughts?
| >
| > ~Kam (^8*
|
| No, that would be a big security breach.
|
| The only thing you can do to transmit information between
| www.another.com and www.mydomain.com is call the URL with parameters,
| for example:
|
| www.mydomain.com?param1=value1&param2=value2
|
| Laurent
| --
| Laurent Bugnion, GalaSoft
| Webdesign, Java, javascript: http://www.galasoft-LB.ch
| Private/Malaysia: http://mypage.bluewin.ch/lbugnion
| Support children in Calcutta: http://www.calcutta-espoir.ch
|
Jul 20 '05 #3
kam bansal <ka*@magickhat.com> writes:
Can javascript read a cookie from a different domain? Meaning, if my
html page is running on "www.mydomain.com" and I goto another domain
"www.another.com" to do some work, and then I come back, can I see the
cookie that "www.another.com" created from my domain???


That depends on security settings.
If you have "disallow third party cookies", then it won't work. Then
"www.another.com" cannot set cookies for other domains than itself.

If not, you can set the cookies with a domain of "mydomain.com".
IIRC:
document.cookie = "dims=data;domain=www.mydomain.com;path=/;expires=..."

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: DanielEKFA | last post by:
Hey hey :) Having a lot of problems with this. I'm helping my brother out with this art school web page. He has a big wish to have random images from the web shown in the background, and asked...
1
by: milindsj | last post by:
Hello, I have a application hosted on tomcat. I use a jsp to set a cookie say channelid. Now I am redirecting this page to some other appliaction which is hosted in tomcat on some other machine....
1
by: Reinhold Mannsberger | last post by:
Hello I want to pass data from one page to another, more specifically I want to pass data from a child page to a parent page My parent page (parentpage.htm) does ----...
9
by: Mike Reed | last post by:
I must be having a "senile" day! I cannot recall, nor get to work, code to read a cookie's expiration date/time in an ASP page/VBScript. What am I missing? *** Sent via Developersdex...
2
by: Bishop | last post by:
Here is my situation. I'm building a web based store that will use the same code base for every store using host headers to determine which data to display. To prevent purchasing a SSL Cert for...
2
by: JDC | last post by:
Hi all, I have an ASP.NET application for which I'd like the "login" page to be secure. The problem I have is that while my hosting company gives me a "secure" option, secure pages appear under...
2
by: Sean | last post by:
I am trying to read a cookie I set but I am not sure if I really set it correctly or I am not reading it correctly. I was given the following instructions to set the cookie. It appears to be...
2
by: Cathy | last post by:
Hi, Is there anyway to set cookie on a different domain? Thanks. Cathy
0
by: singmalay | last post by:
Hi, I am using vbscript (adodb) to connect to a SQL DB that is situated in a different domain with windows authentication configured of that domain. For example if I want to login to the DB I use...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.