[eluser]broadband[/eluser]
I have some temporary data which I decided to save in flashdata (for the next request).
There will be lot of data, more than 4 kB (which is maximum browser cookie size), so I decided to use
database.
Code:
$config['sess_cookie_name'] = 'session';
$config['sess_expiration'] = 7200;
$config['sess_expire_on_close'] = true;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = true;
$config['sess_table_name'] = 'ci_session';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = false;
$config['sess_time_to_update'] = 300;
This way the cookie on the client side, does not contain value, only session_id, expire, .... not user_data.
For testing purposes I tried to save a lot of session user_data in database. Second method test2() does not show anything. Has anybody experienced the same?
Code:
public function test()
{
$string = "test";
for($i = 0; $i < 10;$i++) $string .= $string;
$this->load->library('session');
$this->session->set_userdata(array('test' => $string));
}
Code:
public function test2()
{
$this->session->userdata('test');
}
If I try with php native sessions:
Code:
public function test()
{
$string = "test";
for($i = 0; $i < 10;$i++) $string .= $string;
session_start();
$_SESSION['test'] = $string;
}
Code:
public function test2()
{
session_start();
echo $_SESSION['test'];
}