Welcome Guest, Not a member yet? Register   Sign In
How CI handles PHP native sessions ?
#1

[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 ?


Messages In This Thread
How CI handles PHP native sessions ? - by El Forum - 08-20-2007, 07:06 PM
How CI handles PHP native sessions ? - by El Forum - 08-20-2007, 07:13 PM
How CI handles PHP native sessions ? - by El Forum - 08-20-2007, 07:29 PM
How CI handles PHP native sessions ? - by El Forum - 08-20-2007, 07:38 PM
How CI handles PHP native sessions ? - by El Forum - 08-20-2007, 07:41 PM
How CI handles PHP native sessions ? - by El Forum - 08-21-2007, 05:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB