Session Value Used in Another Domain

  1. <?php  
  2. session_start();  
  3. $sess_life_time = 21600; //in seconds  
  4. $sess_path = "/";  
  5. $sess_domain = ".localhost/second";  
  6. $sess_secure = true; // if you have secured session  
  7. $sess_httponly = true; // httponly flag  
  8. $_SESSION["some_name"] = "rajesh";  
  9. echo $_SESSION["some_name"];  
  10. session_set_cookie_params($sess_life_time$sess_path$sess_domain$sess_secure$sess_httponly);  
  11. ?>