Hi All,
I am trying to create multiple codeigniter sessons for multiple users. I will explain my scenario.
I have developed an application using codeigniter and launched in an ecommerce platfomr so that many shop owners installed my application.
Now from my admin front, I have access to check for each particular user's app interface using the session and redirect method.
I want to make the sessions for all users open in different tabs, when I click on one button.
I have used a for loop.
The iteration works perfect and data are for each user are retrieved perfectly.
But the redirect method opens the session for the first user alone and stops there.
I am just breaking my head on this issue.
I need your help in this issue. I would be very grateful since this is eating my time.
Thanks in advance.
This is the piece of code which I am using.
/*** Code starts here ***/
public function login_as_update() {
$customer = $this->customers_model->read_allshops();
if(count($customer) != 0) {
for($i=0;$i<count($customer);$i++){
$cust_array = get_object_vars($customer[$i]);
$newdata = array(
'shop' => $cust_array['shop'],
'token' => $cust_array['token'],
'plan' => $cust_array['plan'],
'status' => 'active',
'adminaccess' => true,
'id' => $cust_array['id']
);
$this->session->set_userdata($newdata);
ob_start();
redirect(Settings::get('shopify_main_page_redirect'));
}
}
}
/*** Code ends here ***/