Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter v3.1.11 - odd session behaviour
#1

(This post was last modified: 04-13-2020, 09:17 PM by ragingTorch.)

Hello,

I've created a shop application which very rarely shows some odd behaviour in the checkout that I am hoping someone will be able to shed some light on.

Just as any shop site, mine has a membership system and a checkout. Very rarely, logged in members see another member's delivery address in the checkout; seems to be details of a random member that are pulled.

I know for a fact that these members aren't doing anything strange with their session cookie (which is encrypted) nor are they randomly logged out. They simply just see another random member's data in the checkout.

The site is using CI's built session library and doesn't have any other issues with sessions. I can't see any pattern to this bug, so my debugging efforts have been pretty fruitless. Any insight into this will be much appreciated.

CodeIgniter v3.1.11
Here are my session settings:

PHP Code:
$config['sess_driver'] = 'database';
$config['sess_table_name'] = 'session_data';
$config['sess_cookie_name'] = 'mainsite';
$config['sess_expiration'] = 2592000;
$config['sess_save_path'] = null;
$config['sess_match_ip'] = false;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = false
Reply
#2

Set your session expiration to 0 (zero) which tells the session to expire the
session on the web browser being closed.

Logged in users may be seeing other session users data because the session has not
expired.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

Thank you, InsiteFX.

I've lowered the sess_expiration by half (now 14 days) as the site still needs to remember the cart data for user convenience. I have also set sess_regenerate_destroy to TRUE as it may remove some of the older session data as well.
Reply
#4

Back again, and so is the issue. I had lowered the sess_expiration value to 14 days, but today we had some more reports of the problem happening. I think it is less than before, though.

I've set the sess_expiration value to 5 days now. If anyone has a better idea or some other insight, please share.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB