Welcome Guest, Not a member yet? Register   Sign In
Problem with storing CI session
#1

[eluser]KusTov[/eluser]
Hello
I’m using CI session, PHP 5, Explorer 6 (accept all cookies).
Sometimes session don't pass to another page. In the same page there is no problem. In the DB I can see session records.
SiteConfig.php:
Code:
error_reporting(E_ALL);


config.php:

Code:
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_encrypt_cookie']    = false;
$config['sess_use_database']    = true;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent']    = FALSE;

$config['cookie_prefix']    = "";
$config['cookie_domain']    = "";
$config['cookie_path']        = "/";

I use session this way:
first page:
Code:
$error ="Bla bla";
$this->session->set_userdata(array('_MSG_USER'=> $error));
$this->session->userdata('_MSG_USER'); //here it works

Second page (prints nothing):
Code:
<?=$this->session->userdata('_MSG_USER')?>

In Firefox it seems work. But I use DB session. I don't understand what the bug ?
Help me !!!
#2

[eluser]Unknown[/eluser]
Hi.

I have the exact same problem!!
However I found that if I delete all cookies it will work.

It still need to find a way to solve this problem or bug.
#3

[eluser]iive[/eluser]
I have the problem when I tried to save an Object into session... Therefore I use an array instead.. and it works.




Theme © iAndrew 2016 - Forum software by © MyBB