title: Codeigniter : Sharing session variables across subdomains
body: <p>This question have been posted by many others, but I am not getting the exact answer I want.
  I am using Codeigniter framework. I have mysite.com and m.mysite.com.
  I want to share the session variable say <code>user_id</code> across the two. </p>
  
  <p>I am setting the session using <code>$this-&gt;session-&gt;set_userdata()</code>. I have included the following code in config file :</p>
  
  <pre><code>ini_set('session.cookie_domain', '.mysite.com');
  $config['cookie_domain']    = ".mysite.com"
  </code></pre>
  
  <p>and in php.ini I have added <code>session.cookie_domain = .mysite.com</code>  </p>
  
  <p>Should this be done in both ? I mean in mysite.com and m.mysite.com.</p>
  
  <p>Can some one please tell whats going wrong.</p>