Welcome Guest, Not a member yet? Register   Sign In
Automatically session expires using config
#1

[eluser]suba[/eluser]
Dear all,
Code:
$config['sess_cookie_name']    = 'sess_name';
$config['sess_expiration']    = 1800;
$config['sess_encrypt_cookie']    = FALSE;
$config['sess_use_database']    = true;
$config['sess_table_name']    = 'session_table';
$config['sess_match_ip']    = FALSE;
$config['sess_match_useragent']    = TRUE;
$config['sess_time_to_update']     = 300;

This statement from config file. When I setup sess_expiration, system has automatically destroy/clear the session. This is fine

I want to know how this process works?
In CI where is this process code statement?

Because when the session expires , I want to do some process. So I want to know how & where the automatically session expire process happens?

please advise me.
#2

[eluser]WanWizard[/eluser]
In the session library.

A session expires by setting an expiration time on the session cookie. If the expiration time is passed, the browser will delete the cookie, and not send it to the application, which causes the creation of a new session. So this process is client-side, you can't influence it.

The session library also has a garbage collection method, that takes care of deleting expired session records. You might want to extend that method, first query all expired records, do what you have to do, then delete them.




Theme © iAndrew 2016 - Forum software by © MyBB