Welcome Guest, Not a member yet? Register   Sign In
Session Class
#1

[eluser]Unknown[/eluser]
Hey guys,

I new at CodeIgniter and try to read the Session Class with no success.
How can i set the Session Time to Expire since user close the browser?

In the cookie helper, i just have to set de expire time to 0, but if i do this with the session, the expiration time will be set to two years from now.


Thanks any help.

ps: Sorry my poor english, i'm new at this too Smile
#2

[eluser]verynewtothis[/eluser]
These are the steps (also available in the CI docs)
Load session library
Code:
$this->load->library('session');
Set session variable
Code:
$this->session->set_userdata('some_name', 'some_value');
Read Session Variable
Code:
$this->session->userdata('some_name');
Destroy Session Variable
Code:
$this->session->unset_userdata('some_name');

To modify the session expiring times, go to application/config/config.php and modify "sess_expiration"




Theme © iAndrew 2016 - Forum software by © MyBB