How do I increase the size of the session framework CodeIgniter?
The standard size is 04 kb
The Session class permits you maintain a user's “state” and track their activity while they browse your site. CodeIgniter comes with a few session storage drivers: files (default; file-system based) database.
php $session->set('some_name', 'some_value'); If you want to verify that a session value exists, simply check with isset() : <? php // returns false if the 'some_name' item doesn't exist or is null, // true otherwise: if (isset($_SESSION['some_name'])) { // ... }
php create an array to store your session data. $new_data = array( 'username' => 'martin', 'email' => '[email protected]', 'user_logged => TRUE ); $this->session->set_userdata($new_data); Then this is how to call your session data(create a variable and assign it the value of one of the session data you need):
The Session class permits you to maintain a user’s “state” and track their activity while they browse your site. CodeIgniter comes with a few session storage drivers, that you can see in the last section of the table of contents: How do Sessions work? What is Session Data?
Also, just as set () can be used to add information to a session, remove () can be used to remove it, by passing the session key. For example, if you wanted to remove ‘some_name’ from your session data array: CodeIgniter supports “flashdata”, or session data that will only be available for the next request, and is then automatically cleared.
You can either pass a single item or an array of flashdata items to keep. CodeIgniter also supports “tempdata”, or session data with a specific expiration time. After the value expires, or the session expires or is deleted, the value is automatically removed.
CodeIgniter also supports “tempdata”, or session data with a specific expiration time. After the value expires, or the session expires or is deleted, the value is automatically removed. Similarly to flashdata, tempdata variables are managed internally by the CodeIgniter session handler.
It's got nothing to do with the codeigniter session, 4kb of data is the maximum size a cookie can hold.
To hold more data use a database (see "Saving Session Data to a Database" in http://codeigniter.com/user_guide/libraries/sessions.html).
Don't store large amounts of data in a session; it will be loaded into the script's memory on every request.
Use files or databases instead, connecting the data to the session using the session ID.
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