Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 3.1.11 - Session regenerate and data loss PHP 7.3.11
#1

(This post was last modified: 12-12-2019, 08:48 AM by reesethebeast.)

I am using Codeigniter 3.1.11 on my localhost with XAMPP PHP version 7.3.11. I am using database sessions, not file.

I wrote some simple code to put user cart data into the session. On the initial form submission, the data is put in the session and looks good. On refresh, the session is regenerated and the prior session data is not there in the new session but is still there in an old session. Below are my config settings. I tried many combinations and cannot figure out the issue. Why does the session regenerate even when I set to FALSE?

On page refresh, I echo $this->Session->all_userdata() and I receive:

Code:
Array
(
    [__ci_last_regenerate] => 1576124405
)

Each refresh generates a new number.

The initial session data looks good, as below:

Code:
Array
(
    [__ci_last_regenerate] => 1576165611
    [CART] => Array
        (
            [0] => Array
                (
                    [product_id] => XYZ1234567
                    [qty] => 1
                )

        )

)

Config settings

Code:
$config['sess_driver']            = 'database';
$config['sess_cookie_name']        = 'ci_sessions';
$config['sess_expiration']        = 7200;
$config['sess_save_path']          = 'ci_sessions';
$config['sess_match_ip']          = FALSE;
$config['sess_time_to_update']    = 300;
$config['sess_regenerate_destroy'] = FALSE;

$config['cookie_prefix']    = 'card_';
$config['cookie_domain']    = '';
$config['cookie_path']      = '/';
$config['cookie_secure']    = FALSE;
$config['cookie_httponly']  = FALSE;
Reply


Messages In This Thread
Codeigniter 3.1.11 - Session regenerate and data loss PHP 7.3.11 - by reesethebeast - 12-12-2019, 07:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB