Can I use codeigniter session_id to SmartScale sessionid in Tungsten Replicator for MySQL?

87 views Asked by At

I am trying to use Tungsten Replicator for MySQL.
I am using only one database for whole php application.
and I want to use SmartScale feature. to configure SmartScale it needs a sessionid. i found some possible sessionid in their doc(DATABASE,USER,CONNECTION,free string).

for PHP based application they suggested to use PHP session_id as SmartScale sessionid where php session_id doesn't change normally in other pages or next requests. but I am using codeigniter where session_id changes continuously.

in that case can I use codeigniter session_id as SmartScale sessionid to obtain the goal(always get updated data even if read request goes to another slave server where write haven't propagated yet)?

1

There are 1 answers

1
qwertzman On

Would a solution be to set an extra kind of session variable that doesn't change unless the session is destroyed?

An example taken from Session ID is changing in CodeIgniter:

$uniqueId = uniqid($this->CI->input->ip_address(), TRUE);
$this->session->set_userdata("my_session_id", md5($uniqueId));