I my CI application I hit an ajax button, call controller action and want to push new value in already existing session array on every hit. I google but file.
Following are the sources which I tried.
I my CI application I hit an ajax button, call controller action and want to push new value in already existing session array on every hit. I google but file.
Following are the sources which I tried.
Okay I did it :
1- first load old array 2- push new value to array 3- set session
$old_que_ans_session = $this->session->userdata('que_ans_session');
array_push($old_que_ans_session, $qIds[$_POST['my_que_no']]);
$this->session->set_userdata('que_ans_session', $old_que_ans_session);