Codeigniter Session Size Limit

When saving a session to the database through

$config['sess_use_database']    = TRUE;

Is the data size limited by the size of the user_data field, which is TEXT ...? Not 4kb like a regular cookie.

+5
source share
3 answers

To clarify my comment above, when you decided to save session data in a database, CodeIgniter does not set a cookie (except for the session identifier, of course), but it saves all the information that it would set in a cookie in your database.

sess_write Session, ./system/libraries/, , , serialize . , CodeIgniter .

: https://bitbucket.org/ellislab/codeigniter/src/fe2247a927ab/system/libraries/Session.php#cl-252.

, .. MySQL, this.

+4

" ", ci_session

user_data = longtext

longtext NOT UNLIMITED

+1

I think this is the answer to your question. from class code:

// Are we saving custom data to the DB?  If not, all we do is update the cookie
if ($this->sess_use_database === FALSE)
{
    $this->_set_cookie();
    return;
}

even comments belong to the class itself. therefore, it updates the IF cookie without using the database.

0
source

All Articles