[eluser]darkhouse[/eluser]
Unfortunately, passing the session id in the url is the only way, but you can hide it by doing a redirect. I don't know how your "web farm" is setup, but maybe you can have a library that manages the switching between the different sites, something like this:
Code:
class Webfarm {
var $CI;
function Webfarm(){
$this->CI =& get_instance();
$this->CI->load->helper('cookie');
}
function force($domain){
$cookie = get_cookie('PHPSESSID');
redirect($domain.'/xfer/'.$cookie.$this->CI->uri->uri_string());
}
}
So then you can put into any controller, this:
Code:
class Some_page extends Controller {
function Some_page(){
parent::Controller();
$this->load->library('webfarm');
$this->webfarm->force('somedomain.com');
}
function index(){
$this->load->view('page');
}
}
Now, in the webfarm library, in the redirect, you'll see it passing the session id and the uri string to a controller called 'xfer', which would be this:
Code:
class Xfer extends Controller {
function Xfer(){
parent::Controller();
}
function index($sess_id){
$args = func_get_args();
array_shift($args);
$path = implode('/', $args);
$this->load->helper('cookie');
set_cookie('PHPSESSID', $sess_id);
redirect($path);
}
}
So there's just a couple other things to do, add a route for the xfer index:
Code:
$route['xfer/(:any)'] = "xfer/index/$1";
And change the base_url in the config file to this:
Code:
$config['base_url'] = (isset($_SERVER['HTTPS']) ? 'https' : 'http')."://".$_SERVER['HTTP_HOST'].'/';
This is untested, but I think it'll work. I did something similar on a site to transfer sessions between http and https.