Welcome Guest, Not a member yet? Register   Sign In
Update ci_sessions only for registered users
#1

[eluser]Popescu Mihaela[/eluser]
Is there a way to insert data in table ci_sessions only for registered and logged in users? Now I have a lot of data in ci_sessions from not logged in visitors and there is a lot of it.
#2

[eluser]InsiteFX[/eluser]
If that is the case then you must not be expiring your sessions!

Sessions have to expire for them to be deleted out of the database session table.
#3

[eluser]Popescu Mihaela[/eluser]
In my config.php is
Code:
$config['sess_expiration']  = 7200;
$config['sess_expire_on_close'] = FALSE;
$config['sess_time_to_update'] = 300;

What do I need to do in order to keep the sessions for logged in users and to delete the expired sessions for not logged in visitors?
#4

[eluser]CroNiX[/eluser]
Your sessions are set to expire after 2 hours of inactivity. That means they go into a garbage collection system which may or may not immediately remove them.

You can always manually delete them from your session table if last_activity > 24 hours from current time and put that in a cron job that will run once a day or something. Is there a reason why you want to remove them? They will eventually be removed by the garbage collection.




Theme © iAndrew 2016 - Forum software by © MyBB