sess_regenerate() is called in the constructor of the session library. So, any class you use in that method needs to be loaded before the session library (or loaded in that method). At the very least, both uses of Accounts_model should be wrapped in a class_exists() call, especially if you're not going to load it in (or before) MY_Session.