Hi.
I've got 'foo1.com' where users log in by using PHP sessions. I store login and password hash into the session, and each time one user access a webpage, I check them.
But I've created 'foo2.com' and want users not to log in again on another login point, but using the 'foo1.com' login. I mean, if you are logged in 'foo1.com' you are also logged in 'foo2.com'. How to manage it? Must I create a webservice or something similar?
Thank you very much.
How to login into a site from another one?
Moderator: General Moderators
for this you need to set the value for session.cookie_domain. in your login page, before initializing session put this line
ini_set ( 'session.cookie_domain', '.foo2.com' );
for more info visit http://www.php.net/manual/en/ref.sessio ... kie-domain
ini_set ( 'session.cookie_domain', '.foo2.com' );
for more info visit http://www.php.net/manual/en/ref.sessio ... kie-domain
- neel_basu
- Forum Contributor
- Posts: 454
- Joined: Wed Dec 06, 2006 9:33 am
- Location: Picnic Garden, Kolkata, India
Re: How to login into a site from another one?
You Can Do It in 2 ways.guarriman wrote:Hi.
I've got 'foo1.com' where users log in by using PHP sessions. I store login and password hash into the session, and each time one user access a webpage, I check them.
But I've created 'foo2.com' and want users not to log in again on another login point, but using the 'foo1.com' login. I mean, if you are logged in 'foo1.com' you are also logged in 'foo2.com'. How to manage it? Must I create a webservice or something similar?
Thank you very much.
1. First Login On foo1 then after a Succesfull login on foo1 Use curl to loging on foo2.
2.Use Session Identifiers
I think Method 1 is The Siplest and Safest