0

I read all the php Sigon cross domain posts from 2009 and still seems very complex. Basically I have a php ad listing site, with different domains. How could I make this work...

I do have this in my login.php file...

    if(mysql_num_rows($result) > 0){
        $member = mysql_fetch_assoc($result);
        //Login user
        session_register('memberID');
        session_register('FName');
        session_register('LName');
        $_SESSION['memberID'] = $member['ID'];
        $_SESSION['FName'] = $member['FName'];
        $_SESSION['LName'] = $member['LName'];

        $node = new sqlNode();
        $node->table = "members";
        $node->push("defined","LastLogin","NOW()");
        $node->where = "where ID = ".$member['ID'];

        if( ($result = $mysql->update($node)) === false )
            die($mysql->debugPrint());

that works but only for the sigle domain.

  • Partially duplicate: http://stackoverflow.com/questions/4759312/session-share-across-multiple-domains-on-same-server – Hardy Jul 06 '14 at 07:09

2 Answers2

0

If your all sites are connecting to same DB then you can keep user signed by capturing the IP address, browser version, operating system then you can lookups in the database and you can restore session in this way.

..

This might help you multidomain-sso

nana.chorage
  • 496
  • 4
  • 15
0

Due to cross site request forgery it won't work as expected. There are some solutions but not simple. Check here for a better explaination.

PHP authentication with multiple domains and subdomains

Community
  • 1
  • 1
ashtonpaul
  • 106
  • 4