title: Yii : use the login information of one domain to login the user to another domain
body: <p>There are two domains site1.com and site2.com</p>
  
  <p>Both sites have login scripts.</p>
  
  <p>Both sites are in the same server.</p>
  
  <p>Both site access the same user table.(only user table)</p>
  
  <p>If a user logs in to site1.com he should be automatically logged into site2.com</p>
  
  <p>please help.</p>
  
  <p>What I am currently thinking of doing is.</p>
  
  <p>storing the session information in a db when a user logs in from site1.com</p>
  
  <p>There will be a link in site1.com to site2.com with session id of currently logged in user.</p>
  
  <p>When a user clicks on this link the session id will be passed to site2.com and use that sessionid, search the session database and tell the session to read and use that database to log the user in to site2.com</p>
  
  <p>I dont know whether this is correct or not.. I need some expert answers that's I am posting it here. please help me...</p>