Sunday, December 4, 2011

How can a cookie or a session be shared among multiple websites?

I have three websites with three different domains, I want to share either a cookie or a session between the three of them, so if someone logs in one of them, he'll be logged in the others.





The problem is that each website is on different IP address, and two of them are PHP and one is ASP. Is there a way to solve this?|||Truly multi-domain cookies are not possible to create.





The easiest way to solve this issue is to designate one of your domains to be the cookie handling domain for all three sites. You can then include code from that site in a %26lt;script%26gt; tag that checks the login cookie and returns different Javascript based on whether or not the user should be logged in. See the link below for more info (but it's not specifically about doing multiple logins).





A better, but probably harder, way that wouldn't require Javascript would be to set up a database that is accessible to all three servers and store session information there.





Edit: It is certainly possible to emulate this functionality. Try telling the folks at Google and Microsoft and Yahoo, or any other major web portal, that it isn't.|||Bryon: Why is the video an .exe file???





Seems a bit dodgy to me, maybe even XSS?








take care when clicking links people!|||You can not. The whole idea of these is for individual connections to a site.|||you cant. its not possible. specially not the same language.|||Put links on the homepage for all to see with bright headline

No comments:

Post a Comment