I have created a website. When a user is logged I store the user ID in the session.
oooooo.com would be the user website and oooooo.com/test the test website.
Whenever I login on oooooo.com, and then browse to oooooo.com/test, I am already logged-in the test website.
I have worked in PHP but no much idea about handling session.
After login:
$_SESSION['sc_user_id'] = encrypt($result[0]['_id']);
Check user is logged-in or not:
if(!isset($_SESSION['user_name']))
{
header("Location: ".viewpath."/login.php");exit;
}