when redirecting a codeigniter session, it destroys some time of its work and some time when it destroys the session and sends the user to the login page
Here is the Config.php session code
$config['see_driver'] = 'database'; $config['see_cookie_name'] = 'ci_session'; $config['see_expiration'] = 0; $config['see_save_path'] = 'ci_sessions'; $config['see_match_ip'] = FALSE; $config['see_time_to_update'] = 10000; $config['see_regenerate_destroy'] = FALSE;
and thatβs how I set up a user session after logging in and authenticating from the database in User_controller.php
private function __set_user_session($user) { if(isset($user)) { $data = [ 'user_id' => $user['id'], 'ilocal_user_id' => $user['ilocal_user_id'], 'package_id' => $user['package_id'], 'no_available_business' => $user['no_available_business'], 'name' => $user['name'] ]; $this->session->set_userdata($data); } }
After the contact book is connected and redirected, this method is called and automatically redirected to the user on the login page, I do not know why it destroys the session
public function connect_facebook_account($business_id) { $this->__load_business($business_id); try { if(isset($this->data['business'] )) { $this->fb = new Facebook(); $this->data['facebook_url'] = $this->fb->get_login_url($business_id); if(isset($_GET['code'])) { $social_acccount_info = $this->fb->fetch_access_token(); if($social_acccount_info['status'] === TRUE) { $social_acccount_info['business_id'] = $business_id;
this code works fine on localhost, and sometimes it also works on a production server, but most of the time it destroys a production session, but it works on a local machine?
any solution?
redirect php facebook codeigniter session
Rabnawaz Jansher Badozai
source share