When storing the session in the database via
$config['sess_use_database'] = TRUE;
Is the size of the data limited to the size of the user_data field which is TEXT ... ? Not 4kb like a normal cookie.
To further clarify my comment above, when you elect to save the session data in a database, CodeIgniter doesn't set a cookie (other than the session id of course) but saves all of the information that it would have set in a cookie in your database.
If you have a look at the sess_write
in the Session
class located in ./system/libraries/
, if you have enabled the use of a database, you'll see that it serializes the data using serialize
and saves it directly to the database. There is no restriction on length imposed by CodeIgniter when saving to a database.
For your convenience, here's a link to the source code: https://bitbucket.org/ellislab/codeigniter/src/fe2247a927ab/system/libraries/Session.php#cl-252.
The only restriction is set by the field you chose to use to save the data in your database. For more information on the data type storage requirements of MySQL, read this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With