My site uses Session and I’ve configured it to save information to the database to allow me to save larger amounts of user data.
The site also connects to a MySQL and MSSQL database to retrieve information for the user. The Session database is in the MySQL database and this part is working.
The logic of the site goes:
1. User searches for something, the search button is attached to some jQuery code which sends the search term to 2 functions in my controller.
2. Function 1 accesses the MSSQL database, gets the data, saves the query and the results of the query to the session and returns the query results to the View.
3. Function 2 does the exact same except it queries the MySQL database.
Function 1 code does this:
$this->session->set_userdata('get_function1_query',$lastquery);
$this->session->set_userdata('get_function1_result',$query->result_array());
Function 2 code does this:
$this->session->set_userdata('get_function2_query',$lastquery);
$this->session->set_userdata('get_function2_result',$query->result_array());
The problem is that the Function 1 code does not save the data to the session table. If I remove the Function 2 code then the Function 1 code works!
Lastly, The result sets of the queries is small. Even so I changed the datatype of the ‘user_data’ field in the ci_sessions table from TEXT to MEDIUMTEXT to allow more information to be stored there.
Can anyone help?
Thanks!
Solved it using the CodeIgniter native session
http://codeigniter.com/wiki/Native_session
It appears that there are some issues with Sessions and jQuery in CodeIgniter