[eluser]Maikh85[/eluser]
Hi there,
CI's session library has got me pulling my hair out by now. For some weird reason the session data I am setting does not get passed to any next function within the controller.
Where I'm setting the session vars, all is fine. A var_dump shows the variables and their values being correctly set. However, at any other function I call thereafter, all variables have disappeared.
Code:
<?php
function one() {
$this->session->set_userdata(array('test'=>'val');
}
function two() {
var_dump($this->session->userdata);
}
?>
I did some searching and I read it could have to do with $config['cookie_domain'] in the config file. But even when I set that one, I get a session reset. On every page reload the ["session_id"] is reset as well, should this happen?
Hope someone can help me out on this.. Thanks in advance.
EDIT:
This is my config.php on sessions:
Code:
$config['sess_cookie_name'] = 'cisession';
$config['sess_expiration'] = 7200;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = FALSE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
Tried to use db session storage, but that made no difference.