Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Banned
    Join Date
    Aug 2003
    Posts
    12
    Member #
    2580
    Hey everyone.

    I'm Greg. I'm new here. I won't lie... I signed up because I could use some help.

    Problem: I need to create a cookie that can be passed from one domain to the other. I.E. Created from a page on(just an example) republicans.com and stored on democrats.com

    I got all excited because I thought since the two sites are created for the purpose of promoting the same product by the guy who created the product that they would be on the same server and that would be how I made the two domains work together with that cookie. Be D@MNED if I wasn't wrong. lol

    The domains ARE indeed hosted on different servers so that won't work. I don't know enough about cookies to get around this problem. Any ideas?

    Currently I'm trying to work the problem out using frames, because I had been told that it's possible to pass javascript around from frame to frame. Implementing this is proving to be difficult but I have a good feeling I'm on the right track.

    Am I? lol

    Greg Johnson
    Design@new-point-0.com

  2.  

  3. #2
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    I'm fairly certain cookies can't be shared between sites.. it's a big security no-no. Think about it.. vB uses the same cookie on most every vB forum. If one site could steal your info in that cookie.. it could have all your information to any board you've logged into. Albeit this is a weak example, there are other risks invovled as well.
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  4. #3
    Banned
    Join Date
    Aug 2003
    Posts
    12
    Member #
    2580
    Yeah, I just can't think of any other way to pass the data back and forth... and I know it can be done... because well... IT HAS TO BE ... lol

    But seriously... like there's this one script I found:

    http://www.hotscripts.com/Detailed/16636.html

    it boasts that you can do exactly that... but when it got down to actually implementing the cookie and setting the variables... I couldn't figure out at which point to do it ... and since a lot of people have popups and unders disabled it may cause the affiliate to lose their commission because the popunder is prevented from initializing.

    So I thought... hmmm.... frames must be the answer. You could set it up to where the frameset contains a top and a bottom frame... top being the one containing the cookie variables and the bottom being the mainframe taking you to the page of the site on the remote server. And since you can reference across frames with java script it almost makes this seem possible. ya think?

    Greg

  5. #4
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    You don't need frames. You can persist your variables between the sites by using querystring parameters. For instance, you have a cookie on democrats.com with the following values:
    Code:
    name: joe
    age: 27
    waist-size: 38
    To persist them to your other site, you can follow the example of .NET and make your link to republicans.com look like this:
    Of course, if you don't want the values to be easily legible, you can uuencode them so that they're not plain text anymore and give them names that aren't easily understandable.

    Then, republicans.com can decode the values and write its own cookie onload.

    You could also persist the values to republican.com automatically by creating an invisible frame - <frameset rows="0, *"> - and refreshing a page on republicans.com to set cookie values each time something happens on democrats.com that changes one.

  6. #5
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Another thing you could do is that whenever anyone gets to one of the sites, it loads a page on the other site that checks current cookies and sends them back, like so:

    1. User arrives at www.republicans.com for the first time
    2. User gets redirected (by a script in the header that determines they just arrived) to www.democrats.com/cookie_check.php.
    3. cookie_check.php finds a cookie, and redirects them back to the previous page with the added querystring arguements
    4. User winds up on www.republicans.com?name=joe
    5. The page says "Hey Joe !!" and he is amazed


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:42 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com