I am sharing sessions between two subdomains and I can see the member’s information in their different subdomains. If the member logs out, all subdomains are logged out. All is good so far.
However, for example, a.example.com
the form information is POSTed to b.example.com
. This form information is saved in the database, but the member’s ID is not registered. No information is registered to the database with the member. What could be the reason for this?
ini_set('session.cookie_domain',
substr($_SERVER['SERVER_NAME'], strpos($_SERVER['SERVER_NAME'], "."), 100));
setcookie("MID", $_SESSION['uID'], 60 * 60 * 24 * 100, '/', '.example.com');
session_set_cookie_params(60 * 60 * 24 * 100, '/', '.example.com', false, false);
ini_set('session.save_path', $pathStorageMembers . 'sessions');
ini_set('session.cookie_lifetime', 60 * 60 * 24 * 100);
ini_set('session.gc_maxlifetime', 60 * 60 * 24 * 100);
session_start();