Jump to content

cookies between domains


drifter

Recommended Posts

I need to share information between two domains. (NOT SUBDOMAINS)These sites are idential, and on the same server - only thing that changes is the domain name (Stupid I know, Long story involving regulations and politics) - Anyway, I know you can not get a cookie to work between domains.

So Anyway I had the idea to store the data in a text file with an IP address as a name. Then have a cron clearing old files that have not been edited in last X minutes - then I can read this data from both sites as they switch back and forth with out even knowing they are switching.

Obviously the only major risk is the small chance someone is on dynamic IP and disconnects, and someone else connects on same IP and visits same site within X minutes - Obviously since this is a smaller site, the odds are way worse then winning the lottery, and this is not critical financial information or anything, just preferences.

Does this sound like a workable plan? Is there any other ideas for such a problem?
Link to comment
Share on other sites

Does sound like a good plan.  A way to get round the problem of them 'changing ip address' if its dynamic, would be to also store there session number as well as ip.  This wont change unless they exit and the reopen there browser.  As you say the chances are nothing!

Can i ask why your using a text file not a database?  Sounds like it could turn out to be quite a lot of work for cron!  Perhaps you could assign each user and id in a database, and then there session and ip numbers could just be updates using there id as a refrance?
Link to comment
Share on other sites

I guess DB would be good - I was in flat file mode... just got through setting up a bunch of cache files for db calls - I was making 6 db calls per page on info that did not change so I did a bunch of flat file stuff for the cache.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.