Subdomain Login page
<p>I have a login page at <a href="http://accounts.xaos-ia.com/login" rel="nofollow">http://accounts.xaos-ia.com/login</a> when the user logins, I need it to register a session that can be used on xaos-ia.com at the same time, I have tried sending the session id from the main domain xaos-ia.com to accounts.xaos-ia.com/login via the phpsessid variable. </p>

<p>The code of xaos-ia.com/index:</p>

<pre><code>ini_set('session.cookie_domain', '.xaos-ia.com');
session_start();

//load config 
require('inc/config.php');

//set session variables
$user = $_SESSION['user']; 
$userid = $_SESSION['userid']; 
$_SESSION['url'] = $_SERVER['REQUEST_URI'];;
if (isset($user) &amp;&amp; isset($userid)) {
//get userinfo
$userinfo = mysql_query("SELECT * FROM table_name WHERE table='$user' AND table='$userid'");
$userdata = mysql_fetch_array($userinfo);
$userlinks = "Welcome $userdata[fname] | &lt;a href='http://accounts.xaos-ia.com          /logout'&gt;Logout&lt;/a&gt; ";
}elseif (!isset ($user) &amp;&amp; !isset($userid)) {
$userlinks = "&lt;a href='http://accounts.xaos-ia.com/login'&gt;Login&lt;/a&gt;";
} 
</code></pre>

<p>The code of accounts.xaos-ia.com/login:</p>

<pre><code>session_start();
require('inc/config.php');
</code></pre>

<p>to set the sessions on accounts.xaos-ia.com/login, I use</p>

<pre><code>$_SESSION['user'] = $user;
$_SESSION['userid'] = $userid;
</code></pre>

<p>how do I allow the main domain to use the sessions created by the login page, and redirect
back to the main domain?</p>
