473,326 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Cookies being referenced in a second domain

I am trying to use a single cookie in two domains. One sets it (and uses
it), the other uses it. I am trying to use setcookie and set the second
domain name as the valid domain, but it doesn't seem to be working:
Jul 17 '05 #1
3 1264
Try again...

I am trying to use a single cookie in two domains. One sets it (and uses
it), the other uses it. I am trying to use setcookie and set the second
domain name as the valid domain, but it doesn't seem to be working:

setcookie('photographs', 'true', time()+3600,'/', 'example.servehttp.com',
0);

The first domain is on a linux box, the second is on a pc, if that is
relavant.

Thanks
Jul 17 '05 #2
*** Katherine Hall escribió/wrote (Tue, 25 Jan 2005 14:35:22 -0500):
setcookie('photographs', 'true', time()+3600,'/', 'example.servehttp.com',
0);

The first domain is on a linux box, the second is on a pc, if that is
relavant.


Some browsers allow users to block cookies from third parties (domain foo
sets cookie for domain bar). First of all make sure it's not the case.
--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Manda tus dudas al grupo, no a mi buzón
-+ Send your questions to the group, not to my mailbox
--
Jul 17 '05 #3
Katherine Hall wrote:
I am trying to use a single cookie in two domains. One sets it (and uses
it), the other uses it. I am trying to use setcookie and set the second
domain name as the valid domain, but it doesn't seem to be working:


That's correct and it's designed not to work this way. Look at RFC2965:

-------------------------------------8<-------------------------------------
3.3.2 Rejecting Cookies To prevent possible security or privacy
violations, a user agent rejects a cookie according to rules below.
The goal of the rules is to try to limit the set of servers for which
a cookie is valid, based on the values of the Path, Domain, and Port
attributes and the request-URI, request-host and request-port.

A user agent rejects (SHALL NOT store its information) if the Version
attribute is missing. Moreover, a user agent rejects (SHALL NOT
store its information) if any of the following is true of the
attributes explicitly present in the Set-Cookie2 response header:

* The value for the Path attribute is not a prefix of the
request-URI.

* The value for the Domain attribute contains no embedded dots,
and the value is not .local.

* The effective host name that derives from the request-host does
not domain-match the Domain attribute.
[...]
-------------------------------------8<-------------------------------------

Have a look at http://www.faqs.org/rfcs/rfc2965.html and the examples
for 3.3.2.

Regards,
Matthias
Jul 17 '05 #4

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

Similar topics

2
by: Keon | last post by:
Hoi Is it possible to use cookies between different domains? For my site I use 2 domains; the first for my global site with ASP en HTML the second is for my forum located on "hyperboards" a...
27
by: Alan Little | last post by:
If I load a JS file from a different domain, the browser requests it via HTTP, so I assume it sends any relevant cookie headers for that domain; why then can I not access them? E.g. suppose I have...
9
by: Michael Evanchik | last post by:
Hello all, since i wanted to use ssl and its seems easy to do so with this object. Im trying to login to a webserver (aol) for this example. But for some reason, im packet sniffing with ethreal...
1
by: Ken Varn | last post by:
I have a page that uses two cookies. On postback, both cookies are updated and added back into the Page.Response.Cookies collection. For some reason, only the first cookie is actually updated...
6
by: DJones | last post by:
I'm using the following code in my .Net application (.Net v1.1, Windows 2000) to write Session Cookies. HttpContext.Current.Response.Cookies("cookieSession")("SessionID") = strSessionID ...
13
by: yawnmoth | last post by:
Say I wrote an ajax script to send out HTTP requests via ajax. Any cookies that I have associated with that site will be sent along with this HTTP request. Is there a way to prevent this from...
12
by: Don Juan | last post by:
I have a simple html document I have been using for some time on my (i.e.) abc.com domain that uses cookies. I recently purchased a new domain name and set up a service to redirect my new domain...
2
by: Dst | last post by:
I'm trying to interact with some old asp code. I'm logging into the asp page by posting username/password to the asp page using webrequest / webresponse. Now this works ok, the response back is...
9
by: tanya.wang | last post by:
Hi, I have a website that would set two cookies when a user logs in successfully. <% response.cookies("login_status")="OK" response.cookies("login_id")="12345" 'This value is from database....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.