I have Created Session on subdomain but right now i am unable to access session variable on Root domain
Login Page : myaccount.javaignite.com
//authenticate login
Home: page
www.javaignite.com
// here i am unable to get the value
myaccount.javaignite.com/Auth.php
Calling by ajax from index.php
<?php
$sess_name = session_name('app');
session_set_cookie_params(0, '/', '.javaignite.com');
session_start();
if($_POST){
$profile_id =$_POST["profile_id"];
$profile_fullname =$_POST["profile_fullname"];
$profile_img =$_POST["profile_img"];
$profile_email =$_POST["profile_email"];
$_SESSION["profile_id"] =$profile_id;
$_SESSION["profile_fullname"] =$profile_fullname;
$_SESSION["profile_img"] =$profile_img;
$_SESSION["profile_email"] =$profile_email;
$redirect_url ="http://javaignite.com";
if(isset($_SESSION["redir_url"])){
$redirect_url =$_SESSION["redir_url"];
}
echo $redirect_url;
die;
}
?>
javaignite.com/navigation.php
which is include in myaccount.javaignite.com/index.php and index.php (in root)
<?php
print_r($_SESSION);
if(isset($_SESSION["profile_id"])){
?>
<ul class="nav navbar-nav navbar-right" style="margin-right:10px;">
<li class="dropdown selected">
<a class="" href="http://account.javaignite.com/profile"> <i class="fa fa-sign-in"></i>
<?php echo $_SESSION["profile_name"]; ?> </a>
</li>
</ul>
<?php
} else {
?>
<ul class="nav navbar-nav navbar-right" style="margin-right:10px;">
<li class="dropdown selected">
<a class="" href="http://account.javaignite.com/"> <i class="fa fa-sign-in"></i> Login/Signup </a>
</li>
</ul>
<?php
}
?>