473,388 Members | 1,335 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,388 software developers and data experts.

passing information between webpages using cookie

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
3 4272
"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
14
by: Antoni | last post by:
Hello, I wondered if anyone could offer some guidance over my php script. I was hoping the example would allow the user to click the submit buttons and the item number increment. And when the...
1
by: Jim Mitchell | last post by:
I have one ASPX page that calls another using server transfer as shown below. The problem is that I do not get the cookie in the second page. The value seems to be blank. Any help would be...
1
by: Joe | last post by:
I am trying to write a Perlscript to be used with some HTML pages. Here is how it works: 1.. The first HTML page has a form which requests for user input. Then it passes the QUERY_STRING...
6
by: Rob Meade | last post by:
Hi all, At work we have 2 servers in a cluster for our web apps. One problem we have experienced (along with many others!) - is that if a user is logged into one of the applications on server...
4
by: Jason Us | last post by:
Does anyone have experience with passing variables from an ASP page to a JSP page. The way it currently works in passing the SSN in the URL. This cannot be good. I thought that storing a...
0
by: David | last post by:
Hi all, I have to screen scrape a site to put into our templates. (We have the site owners permission). The site has a login screen, and I can successfully post credentials using...
4
by: jpsnowjr | last post by:
I'm looking for the best way to pass login data from a SingleSignOn page (written in ASP) to a page in my application (written in ASP.NET). I'm using Roles-Based FormsAuthentication in my app, but...
3
by: =?Utf-8?B?QW5keQ==?= | last post by:
Hi, I'm having issues with what I'm *sure* is a simple problem. Basically having a problem passing a cookie between two sites. On Site A you sign in, and create a cookie with the users ID in it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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...

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.