Welcome Guest, Not a member yet? Register   Sign In
New hook points for sessions start / stop
#1
Lightbulb 

Will there be new hook points in future versions? What I'd like is a hook point when a new session is started / created and when a session is closed / destroyed / expired. That way I can log when a user login or logout.
Reply
#2

Session creation does not mean user log in. It simply means the session was started. I would write to log when your login method receives a login and you successfully log in the user, either through some library(ionauth,...) or you do it manually.

As for log out, I would do the same with the logout button/method. For timeouts, you really can't know, except if you log each request of a user, than add <amount of session timeout> to the last user action, and you will know the time when the users session has timed out.
Reply
#3

(11-24-2014, 02:12 AM)slax0r Wrote: Session creation does not mean user log in. It simply means the session was started.

Yes, I know! There's no login function in CI. I already run my function in my login and logout library. But unless I hack the core files, I can't run my function when the session expires.
Reply
#4

Can you share your library so we can better discuss about your ideas? Wink

Reply
#5

(This post was last modified: 11-24-2014, 12:29 PM by includebeer.)

(11-24-2014, 11:38 AM)Rufnex Wrote: Can you share your library so we can better discuss about your ideas? ;)

There's nothing special about my library. The code for the session expiration is in the Session library.

In fact, I think the best approach would be to extend the Session library. I can override the sess_destroy function, log the info for the expired session, then call parent::sess_destroy  ;)
Reply
#6

Let us wait for the rewritten session lib, i think there are usefull changes.

Reply
#7

Yes, I need to start looking at all the new stuff in CI3. I was waiting for the official release, but I heard multiple time it's almost finish. So I think now is the time to jump in !
Reply




Theme © iAndrew 2016 - Forum software by © MyBB