I have a two subdomain (one.mismodomino.com and two.mismodomino.com) the first is done in PHP call it "Pure" and the other is done in Codeigniter, both work normally but I want to share a session between both subdomains for example the $ _SESSION ['names'] or $ this- > session-> userdata ('names') is accessible from both codeigniter and PHP.
Achieved so far:
In codeigniter I have the native sessions of php $ _SESSION ['names'] or $ this- > session-> userdata ('names') give me the same result, it's more in a third subdomain echo in codeigniter a test mode "tres.mismodomino.com", if you read the session of the other made in codeigniter, but PHP Puro does not recognize them.
Codeigniter Config Code of two.mismodominio.com
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '.mismodominio.com';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
In the cController of uno.mymodomain.com
public function cargaVariable(){
$this->session->set_userdata('nombre',"Alex");
$_SESSION['nombres']="Alexander";
}
On the PHP page in one.mymodomain.com
session_name('ci_session');
ini_set('session.cookie_domain', '.mismodomino.com' );
session_start();
echo "Aqui abajo debe Mostrar algo<br>";
echo $_SESSION['nombres'];
echo $_SESSION['nombre'];
In PHP's it does not print anything. Thank you in advance for your support.
(By the way, you can not pass the PHP to codeigniter (It's another module))