[eluser]Unknown[/eluser]
hello, I've problem when I use session to my php project.
now I want to UPDATE STATUS USER to OFFLINE when user is inactive for a while.
I think it might use session to update it so I test it following this
Code:
$config['sess_expiration'] = 30;
and I'm coding when session was null it will redirect to homepage. now it work. after 30 second it refresh perfectly.
then I insert code that update to database by reading
Code:
$this->userdata['mid']
that was USER ID that want to set to OFFLINE.
I test the function "setOffline($mid)" it can work.
then I add this function into "System/library/Session.php" in the first line of this function "function sess_destroy()" I think before clear session it must be updated database from session[USER ID] before. and I test it. it doesn't work. database won't update.
and I debug it until I delete all code in "function sess_destroy()" I think it will not redirect page again because sess_destroy fucntion is null. but!! it can delete session success after 30 second!! why session was delete successful I edit "sess_destroy()" to null??? or it cal other function when igniter want to delete session. I try to find all file but I can't found anywhere has variable "sess_expiration". so where do I insert update to database function when session was delete :'(