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

Pass parameter between pages in different domains (with access to both)

Hello. I need to transfer an MD5 digest number between two pages on
different domains. I know this is generally not possible, but I have full
access on one domain and can insert Javascript at will into tha pages of the
other. I'd like to be able to store the number into a cookie for retrieval
by either set of pages.

I've been racking my brains for a couple of days on this one and just can't
come up with the answer.

Thanks in advance!

Jul 20 '05 #1
1 3889
"WeAreGoing!" <no****@reply-to-group.com> writes:
Hello. I need to transfer an MD5 digest number between two pages on
different domains. I know this is generally not possible, but I have full
access on one domain and can insert Javascript at will into tha pages of the
other.
I'd like to be able to store the number into a cookie for retrieval
by either set of pages.


Instead of trying to dodge the different-domain security settings,
which will probably not work consistently across browsers, or even
survive a patch, I would do something simpler:
Let the page that sets the cookie also load a page from the other
domain. Pass the number in the search string to that page.

You will then end up with different cookies for the different domains,
so you must keep them synchronized.

Example code:
On page in first domain:
---
function setCookieOtherDomain(cookie,returnUrl) {
location.href = "http://www.otherdomain.com/"+
"setCookieFromFirstDomain.html"+
"?cookie="+escape(cookie)"+
"&return="+escape(returnUrl);
}
---
On setCookie page in other domain:
---
<script type='text/javascript'>
function parseInput(input) { // works for search or cookies
var data = {};
if (input == "") {return data;}
var inputs = input.split("&");
for (var i in inputs) {
var parts = inputs[i].split("=");
data[unescape(parts[0])]=unescape(parts[1]);
}
return data;
}
var input = parseInput(location.search.substr(1));
setCookieFunction("cookie",input["cookie"]); // some function you define
location.href = input["return"];
</script>
---
(untested)

Good luck.
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

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

Similar topics

5
by: Fresh Air Rider | last post by:
Hello Could anyone please explain how I can pass more than one arguement/parameter value to a function using <asp:linkbutton> or is this a major shortfall of the language ? Consider the...
2
by: Mike Taylor | last post by:
My ASP.NET application is a league-management system (for soccer etc.). The league which is being viewed is determined in a URL parameter, eg.: http://www.mydomain.com/default.aspx?leagueid=3 ...
9
by: Alan Silver | last post by:
Hello, I'm a bit surprised at the amount of boilerplate code required to do standard data access in .NET and was looking for a way to improve matters. In Classic ASP, I used to have a common...
7
by: Doug | last post by:
An ASP.NET session cookie set on "www.mydomain.com" can not be accessed on "search.mydomain.com"; hence, a new session and cookie are being created on every sub-domain. This is occuring because...
3
by: Purti Malhotra | last post by:
Hi All, In our Web hosting environment we are using Virtual hosting i.e. multiple websites are on one server and multiple domains are pointing to a single website. Issue: We have two domains...
8
by: pt36 | last post by:
I have two pages one.html two.html page one.html have a form named form1 and a textarea named text1 man one write in the textarea text 1 page two.html have a form named form2 and a...
5
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, Is there an easier way to handle that? I used Javascript to handle this when our two domains are hosted on two different servers(on different networks) and our search engine marketing...
12
by: Bryan Parkoff | last post by:
I write my large project in C++ source code. My C++ source code contains approximate four thousand small functions. Most of them are inline. I define variables and functions in the global scope....
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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.