[eluser]Référencement Google[/eluser]
Hi,
I am not sure about how do CI handles native PHP sessions ($_SESSIONS) because I get problems, it seems that my sessions are not kept between pages.
I have a library to manage sessions from DB (db_session) but I would like also to use some sessions as the classic way, having for some things the use of the DB, and for some other things the use of native sessions.
Some code maybe will help:
config.php
Code:
$config['sess_cookie_name'] = 'NipX';
$config['sess_expiration'] = 7200;
$config['sess_encrypt_cookie'] = TRUE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = TRUE;
$config['sess_match_useragent'] = FALSE;
$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
Some controller part:
Code:
if(!isset($_SESSION['category']))
{
$_SESSION['category'] = $this->view_category();
echo $_SESSION['category']; // for debugging
}
$this->category = $_SESSION['category'];
Unfortunally at each page load, the session value is changed, in a classic PHP script, it wouldn't be...
Could somebody help ?