最简单的办法:

ini_set('session.cookie_domain', '.iw3c.com' );
$some_name = session_name("iw3c"); //必须加
session_set_cookie_params(0, '/', '.iw3c.com'); //必须加
session_start();

麻烦但推荐的办法,把session的储存方式改成memecached

ini_set("session.save_handler", "memcached");
ini_set("session.save_path","127.0.0.1:11211");
//多个memcached
ini_set("session.save_path","127.0.0.1:11211,127.0.0.1:11211");