Question: I need to pass an array from one function to another.
I tried with session variables.

```
$array;
$this->session->set_userdata('array',array);

$array = $this->session->userdata('array');

```

but it does not work for older arrangements 2KB. 

I read that you can not spend such a long array, that session variables are stored in cookies on the browser and does not allow more than 2 or maximum 4KB according to the browser.

I tried to serialize also. Any ideas?

Answer: 
Switch sessions to database, then you can store larger amount of data. See <http://www.codeigniter.com/user_guide/libraries/sessions.html#database-driver> for details.
You have two option on this issue.

1. Don't store every data in session. Store somthing unique.

> 
> **Explenation:** if your database having all the user data and you are trying to store all the in session. Its worthless. ***Just store user id with session time So when ever you need and user data you can call the session user id and send request to database and get the user information.***.
> 
> 
> 

2. Can use session tables which provided by Codeigniter.