passing information between webpages using cookie

S

Song Zhang

I have two webpage, one is http://appA.mycompany.com/first.html and the
other is http://appB.mycompany.com/second.html

When a user visits first.html, he may click a button A, which launches
second.html. In second.html, there is a button, if clicked, a cookie is set
with “mycookie=ok;domain=.mycompany.com”.

At first.html, I have a function that keeps checking cookie with name
mycookie. If mycookie is set, an alert window is started to show the value
of mycookie.

My question is principally, is this doable? Thx in advance.

_________________________________________________________________
Instant message with integrated webcam using MSN Messenger 6.0. Try it now
FREE! http://msnmessenger-download.com
 
L

Lasse Reichstein Nielsen

Song Zhang said:
I have two webpage, one is http://appA.mycompany.com/first.html and
the other is http://appB.mycompany.com/second.html ....
In second.html, there is a button, if clicked, a cookie is set with
“mycookie=ok;domain=.mycompany.com”.
At first.html, I have a function that keeps checking cookie with name
mycookie. ....
My question is principally, is this doable? Thx in advance.

Technically, yes. However, it only works if the user's browser allows
cross-domain cookies, and not all browsers (or users) do that.

It is, however, probably your only chance of communicating between
pages in different domains.

/L
 
M

MikeB

How about if you use a HTA as your host and open each page in its own frame? I haven't done exactly
what the OP is asking, but similar to what I am describing. When you open each page, set a handle
to the window and just use a variable and I suppose a timer in the HTA to keep checking for a change
in the value of the variable.
 
B

Bryan Field-Elliot

This is not really a cross-domain cookie, it's a domain-wide cookie.
Most browsers allow this by default. What Song is proposing will work,
if he can write the Javascript timer code appropriately in first.html
(e.g. go to sleep for 1 second, try reading the cookie, etc.).
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top