I am creating an application which requires a login. The user is able to login, and the application will identify if the user has entered the correct credentials. From here the user will be presented with a dashboard containing information specific to them.
Once a user has entered the correct details, the following code executes:
$this->load->library('session');
$this->session->set_userdata('logged_in', true);
redirect('dashboard', 'refresh');
The application will direct the user to the correct location, which contains the following code:
$this->load->library('session');
print_r($this->session->all_userdata());
This will display the standard session information (session_id, ip_address etc.), but the data in which I stored is not shown.
How do I go about fixing this so that this session data is accessible on every page?
Any help would be greatly appreciated.
Edit:
Here are the current settings for sessions/cookies in config.php:
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = TRUE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
$config['cookie_secure'] = FALSE;