Hi
it's first time that I use Codeigniter. after authentication for login I set session in Login_model.php:
PHP Code:
$data_session = array(
'PersonId' => $PersonId,
'PersonEmail' => $PersonEmail,
'PersonName' => $PersonName,
'PersonFamily' => $PersonFamily,
'Login' => true);
$this->session->set_userdata($data_session);
I can see my data by :
PHP Code:
print_r($this->session->userdata());
on Login_model.php file . they are some thing like this:
Code:
Array
(
[__ci_last_regenerate] => 1510383844
[PersonId] => 129
[PersonEmail] => [email protected]
[PersonName] => PersonName
[PersonFamily] => PersonFamily
[Login] => 1
)
but when I redirect to another page I can find them. my print_r result is this:
Code:
Array
(
[__ci_last_regenerate] => 1510384212
)
my current setting:
config.php
PHP Code:
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'east';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = sys_get_temp_dir();
//$config['sess_save_path'] = 'ci_sessions';
$config['sess_match_ip'] = TRUE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
//------------------
$config['cookie_prefix'] = '';
$config['cookie_domain'] = 'http://domain.com/admin/';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
autoload.php
PHP Code:
$autoload['libraries'] = array('database','template','session','encryption','form_validation');