NYCPHP Meetup

[nycphp-talk] Keep login on two sites simultaneously by just login in any of the two sites..

Rahmin Pavlovic rahmin at insite-out.com
Wed Sep 12 06:28:38 EDT 2007


Aniesh joseph wrote:

> Hello,
> 
> Is it possible to share the session in two sites? I have two sites both of
> them having same contents(login id & password) in the database.. So someone
> login in siteA, possible to login in siteB automatically?
> 

I like to keep a sort of "bridge" table for things like this.

Say, user logs into site A, and their session id -- or some hash of their
personal data -- gets stored in the bridge table with a timestamp (and user
id, or whatever else you want to link up to).

If you drive content from one site to another, you could append their
session id to the URL, and lookup that user on site B, within a given
timeframe (say, 30min since the bridge timestamp was inserted).

If the user/pass info is exactly the same on both sites, you could store a
hash of that in the bridge table (as opposed to the session).

If logins to site B are sensitive, you could include a counter in the bridge
table to only allow one concurrent login.





More information about the talk mailing list