Welcome Guest, Not a member yet? Register   Sign In
Session size for concurrent users
#5

(12-07-2015, 04:19 AM)Narf Wrote:
(12-07-2015, 01:13 AM)Diederik Wrote: The session data is always stored serverside. A cookie is data stored in the client side. When you use a session in PHP a small cookie is created (a session id token). That way the session id is stored clientside and PHP makes the connection between the user (based on the session id) and all the data inside the session (stored on server).

The SQL that is used to create the table that stores the sessions:

Code:
CREATE TABLE IF NOT EXISTS  `ci_sessions` (
    session_id varchar(40) DEFAULT '0' NOT NULL,
    ip_address varchar(45) DEFAULT '0' NOT NULL,
    user_agent varchar(120) NOT NULL,
    last_activity int(10) unsigned DEFAULT 0 NOT NULL,
    user_data text NOT NULL,
    PRIMARY KEY (session_id),
    KEY `last_activity_idx` (`last_activity`)
);

The data itself is stored as a TEXT field which can hold 64 Kilobytes. The 4K you refer to is the max size of a cookie (all cookies for a domain are counted together).

This SQL code refers to the CI2 sessions ... which are in fact always stored in a cookie. Even when you use a database, it's just a duplicate of the cookie-stored data.

CI3 matches your description, but uses a different database structure (that is, if you pick the database session driver).

I'm using CI3, and know about different drivers. My mean was not about database driver for sessions. I mean default driver (file driver) and store some data. As you know, we could have flashdata, tempdata ,... I put some necessary alarms in flashdata, and this is will removed automatically for next request. I put some info (and now, it is just user_id) in a session:
$this->session->set_userdata('user_id', $user_id);
set this for use in other controllers and...
For this type, if many users logged in and want to surf website, is there size limitation?
I want to know this.
thanks.
Reply


Messages In This Thread
Session size for concurrent users - by pb.sajjad - 12-01-2015, 05:29 PM
RE: Session size for concurrent users - by Narf - 12-07-2015, 04:19 AM
RE: Session size for concurrent users - by pb.sajjad - 12-26-2015, 11:55 AM
RE: Session size for concurrent users - by Narf - 12-27-2015, 04:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB