drifter Posted December 6, 2006 Share Posted December 6, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/29733-cookies-between-domains/ Share on other sites More sharing options...
the_oliver Posted December 6, 2006 Share Posted December 6, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/29733-cookies-between-domains/#findComment-136507 Share on other sites More sharing options...
drifter Posted December 7, 2006 Author Share Posted December 7, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/29733-cookies-between-domains/#findComment-136562 Share on other sites More sharing options...
the_oliver Posted December 7, 2006 Share Posted December 7, 2006 fair play! does the session thing sound like a good idea though. Never tried it so would be intrested to know if it would work! Quote Link to comment https://forums.phpfreaks.com/topic/29733-cookies-between-domains/#findComment-136564 Share on other sites More sharing options...
drifter Posted December 7, 2006 Author Share Posted December 7, 2006 I am doing a bit of playing to see Quote Link to comment https://forums.phpfreaks.com/topic/29733-cookies-between-domains/#findComment-136587 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.