Welcome Guest, Not a member yet? Register   Sign In
Cart Class Issue
#1

I Am Building an E-commerce Site Using Codeigniter 3. The site was Running fine until i faced a huge bug in the cart class of the system.

The CI Cart or Session Class Does  not Matches user ip address by default and also if there is anything in the session of cart  class from one ip address and if it remains as it is from that ip and someone else from another ip address adds something in the cart session... the old session data from the other ip gets included into the new users data


it seems to be a real issue or m i missing something???  Undecided Undecided
Reply
#2

Did you setup your session table correctly?

You may need to add a Primary Key etc;

Code:
For MySQL:

CREATE TABLE IF NOT EXISTS `ci_sessions` (
       `id` varchar(128) NOT NULL,
       `ip_address` varchar(45) NOT NULL,
       `timestamp` int(10) unsigned DEFAULT 0 NOT NULL,
       `data` blob NOT NULL,
       KEY `ci_sessions_timestamp` (`timestamp`),
);

// When sess_match_ip = TRUE
ALTER TABLE ci_sessions ADD PRIMARY KEY (id, ip_address);

// When sess_match_ip = FALSE
ALTER TABLE ci_sessions ADD PRIMARY KEY (id);

// To drop a previously created primary key (use when changing the setting)
ALTER TABLE ci_sessions DROP PRIMARY KEY;

Only MySQL and PostgreSQL databases are officially supported, due to lack of advisory locking mechanisms on other platforms.
Using sessions without locks can cause all sorts of problems, especially with heavy usage of AJAX, and we will not support
such cases. Use session_write_close() after you’ve done processing session data if you’re having performance issues.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB