网站的多个域名指向同一个网站目录(注意:不适合服务器集群系统)。关于服务器集群系统怎么作的,我还不知道,有知道的请联系我,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