Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14343

why my session lost in other pages?

$
0
0
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] => h@q.com
  [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'); 

Viewing all articles
Browse latest Browse all 14343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>