Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

size of session in codeigniter

How do I increase the size of the session framework CodeIgniter?

The standard size is 04 kb

like image 935
Pedro Avatar asked Dec 13 '10 16:12

Pedro


People also ask

What is session in CodeIgniter?

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.

How check session is set in CodeIgniter?

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'])) { // ... }

How can store value in session in CodeIgniter?

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):

What is the session class in CodeIgniter?

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?

What is the difference between set() and remove() in CodeIgniter?

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.

How do I keep data in CodeIgniter after it expires?

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.

What is tempdata in CodeIgniter?

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.


2 Answers

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).

like image 117
fire Avatar answered Sep 18 '22 20:09

fire


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.

like image 41
Pekka Avatar answered Sep 21 '22 20:09

Pekka