View Full Version : Cookies!!! Setting cookies from site A for site B
jjmancini
November 8th, 2006, 08:11 PM
Hey Everyone!!!
Here is the problem I am having. Say you have two sites. Site A and site B. Site A needs to set a cookie via javascript of the domain of site B. The javascript that needs to do this is on site A, but will be called via a javascript include on site B.
Here is another example:
Site A=google.com
Site B =flickr.com
When a user visits google.com, a cookie needs to be given to the user that flickr.com can read.
All you javascript gurus out there! Let me know if you have any thoughts!!!
Thanks!
Jeff Wheeler
November 8th, 2006, 08:17 PM
I don't think it's possible. :-/
bwh2
November 8th, 2006, 08:39 PM
if site A had an API, site B could just access info using the API.
chriskalani
November 9th, 2006, 06:50 PM
^true
jjmancini
November 9th, 2006, 07:45 PM
hmmm... Has anyone ever built an API that could give me start? Thanks again everyone!
Jeff Wheeler
November 9th, 2006, 07:53 PM
Well, two popular methods are SOAP and REST. Try Googling 'em:
SOAP
and
REST
jjmancini
November 14th, 2006, 02:21 PM
Great! Thanks for the info!
jjmancini
December 6th, 2006, 04:52 PM
Are there any other possibilities besides an API? THanks!
MTsoul
December 6th, 2006, 05:33 PM
What exactly do you want to do?
From your first post, if that method was available to use, hacking would be as easy as typing a few letters. Describe what you are trying to achieve without using technical terms.
jjmancini
December 7th, 2006, 04:27 AM
I am trying to achieve two things:
1) Give credit for a link back to a website. For example: If frunder.com is linking back to TagACloud.com, I want frunder.com to get the credit.
2) But, I also want the pagerank to transfer to the actual homepage of tagacloud.com so the link needs to be: http://www.tagacloud.com with no trailing ?id=123 or something like that.
So that is what I am trying to do in a nutshell, and want to know if it is possible via cookies, or any other way for that matter.
Thanks again!
MTsoul
December 7th, 2006, 02:47 PM
In that case, you can do it with referrers. In PHP/whatever dynamic server language you are using, check the referrer of the page to determine who redirected to your site. That solves your first problem. You can also determine which page to display using the referrer. That solves your second problem.
jjmancini
December 7th, 2006, 05:12 PM
Well, MTsoul, that is a good suggestion, but we need that code to be independant of a page. For example if frunder.com wanted to link to tagacloud.com, but, from a forum post or from an ad on another page, we would like that link to get credit.
MTsoul
December 7th, 2006, 05:18 PM
What's the problem with referrers though? It does exactly what you want.
For example,
site1.com -> site2.com -- the referrer site2.com gets is "site1.com"
site1.com/whatever/ -> site2.com -- the referrer site2.com gets is "site1.com/whatever/"
So the exact page is preserved.
jjmancini
December 7th, 2006, 06:39 PM
yeah but I mean:
site1.com -> site2.com
chicken.com -> site2.com
kirupa.com -> site2.com
and then site1 get all the credit because they posted the link.
Templarian
December 8th, 2006, 12:38 AM
yeah but I mean:
site1.com -> site2.com
chicken.com -> site2.com
kirupa.com -> site2.com
and then site1 get all the credit because they posted the link.
site2.com will read it as:
site1.com linked to me
chicken.com linked to me
and kirupa.com linked to me.
Why would you want to give all the credit to site1.com if you wanted to do that then set whoever links to you first as credit.
(your whole idea on this makes absolutly no sense so far and doesnt pann out much).
if you want to get http://www.kirupa.com from http://www.kirupa.com/?id=sadfasdf there are strip functions that will return http://www.kirupa.com or even kirupa.com or any part you want.
MTsoul
December 8th, 2006, 12:59 AM
yeah but I mean:
site1.com -> site2.com
chicken.com -> site2.com
kirupa.com -> site2.com
and then site1 get all the credit because they posted the link.
Temp is exactly right. Site1 doesn't get all the credit. Whoever referred to your site gets the credit. That's the whole point of a referrer - it dynamically detects who JUST referred here.
jjmancini
December 8th, 2006, 12:29 PM
Thanks for the replies everyone!
(your whole idea on this makes absolutly no sense so far and doesnt pann out much).
Ok, then let me re-explain.
Think of it like an affiliate program. No matter where a person (We'll call him Bob) puts a link, whether it is on his own webpage, or a forum, or a blog etc, Bob needs to get the credit, because it is his referral.
Does it make sense now?
The second part to my problem, is that I want the homepage to get the pagerank. So I can't have a link that has a trailing ?id=123 because that page then gets the PR.
So to re ask the question with Bob in the picture:
How can Bob link to kirupa.com, via his site, a forum, a blog etc. and still get credit for it, AND the link must transfer pagerank (http://www.kirupa.com in that format)?
That is why I started to go the cookie route. But if there are any better ways, please let me know! Even javascript!
Thanks everyone for you help!
MTsoul
December 8th, 2006, 01:43 PM
Did you read temp's or my post? The referrer is automatically transferred to the dynamic page no matter what it is.
jjmancini
December 8th, 2006, 05:18 PM
I did read your guys post, but I want Bob to get the credit no matter what site it comes from. So I don't care about the site getting the credit, Bob needs to get the credit whether he has his own page, or on kirupa forum, or anywhere.
Bob needs to get the credit for the refferal, not the actual reffering site.
Jeff Wheeler
December 8th, 2006, 06:43 PM
Then just log his IP, or give him a cookie whenever he visits your own site.
DDD
December 8th, 2006, 07:04 PM
You should look up "affiliate marketing" or snoop around commission junction. I think there you will find some good stuff about what you are trying to do. But it sounds like you are trying to "stuff cookies" which is frowned upon.
jjmancini
December 9th, 2006, 07:50 PM
Hey thanks guys for your help!!!
What I think I am going to do, is open up a new thread, and re-ask the question in a lerger way. I thought initially cookies would work, but after many good suggestions cookies is not the way to go.
So I will repost and re-explain what I need to do. Thanks again guys!
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.