By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,213 Members | 1,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,213 IT Pros & Developers. It's quick & easy.

passing information between webpages using cookie

P: n/a
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

Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Song Zhang" <so****@hotmail.com> writes:
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
--
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 #2

P: n/a
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.
"Lasse Reichstein Nielsen" <lr*@hotpop.com> wrote in message news:y8**********@hotpop.com...
"Song Zhang" <so****@hotmail.com> writes:
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
--
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 #3

P: n/a
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.).
--

Bryan Field-Elliot
http://netmeme.org


Lasse Reichstein Nielsen wrote:
"Song Zhang" <so****@hotmail.com> writes:

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


Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.