網站的多個域名指向同一個網站目錄(注意:不適合服務器集羣系統)。關於服務器集羣系統怎麼作的,我還不知道,有知道的請聯繫我,QQ:602148751php
只須要在訪問的入口文件定義html
ini_set('session.cookie_domain', ".domain.com"); //跨域訪問Session跨域
。如下是50玩家多個域名的設置。安全
header("Content-type: text/html; charset=utf-8");
ini_set('session.cookie_domain', ".50wj.com");//跨域訪問Session
// 檢測PHP環境
if(version_compare(PHP_VERSION,'5.3.0','<')) die('require PHP > 5.3.0 !');
// 開啓調試模式 建議開發階段開啓 部署階段註釋或者設爲false
define('APP_DEBUG',false);
define('APP_NAME', 'MyHome');
define('APP_PATH','./Application/');
define('BUILD_DIR_SECURE', false);// true 爲自動生成目錄安全文件
define('WEB_ROOT_PATH', rtrim(dirname(__FILE__), '/\\').DIRECTORY_SEPARATOR);//物理根目錄
require './ThinkPHP/ThinkPHP.php';服務器
經測試1.50wj.com www.50wj.com 的 session 互通cookie