title: PHP Codeigniter sharing session
body: <p>I had problem with session sharing. Can session be shared across domain? I'm using PHP codeigniter framework for my project.
  I had this case where I got 2 domain name register in server and I use 1 application.
  Eg:
  domainA = www.domainA.com
  domainB = www.domainB.com</p>
  
  <p>for domainA, i used default application</p>
  
  <p>—-application
  —-images
  —-system</p>
  
  <p>for domainB, i create new folder named domainB</p>
  
  <p>—-application
  —-domainB
    —-application
  —-images
  —-system</p>
  
  <p>By using htaccess, i rewrite rule whenever link is www.domainB.com it will pointing to domainB folder. This case, it working fine.</p>
  
  <p>The problem is, the session created in domainA are not same as domainB. This is troublesome if we had to gather data from both domainA and domainB. Eg, let said, I add product A to add to cart in domainA, and another product B in domainB, i want to collect these both product and call it in shopping cart in domainA. Can i do that?</p>
  
  <p>Need advise on how to implement these kind of problems? Usually when coding shopping cart we have to use session to keep the products in shopping cart at certain amount of times. Are there any other methods beside this? I had searched in google mostly i read the replied was something like this:</p>
  
  <p>Assume you have a sites called www.innovativephp.com and www.innovativejs.com hosted on same server. Even though both sites are on same server, domain names are different hence you will see that the cookies will not be working in another top domain. :(</p>
  
  <p>Thanks.</p>