Welcome Guest, Not a member yet? Register   Sign In
Overiding CI Class Functions
#1

[eluser]veritascs[/eluser]
I want to override the _sess_gc() function in the Session's class to not remove records that have certain session data (basically don't remove sessions where it has the user logged in). Can I do this by creating a MY_Session class/library and extending it with CI_Session, then making my own _sess_gc() function?

Basically in code application/libraries/MY_Session.php:
Code:
class MY_Session extends CI_Session {
    
    function _sess_gc()
    {
        //blah all my new code for the function
    }
}
#2

[eluser]Colin Williams[/eluser]
That is exactly what you would do, yes.




Theme © iAndrew 2016 - Forum software by © MyBB