def on_expiration(self, session, expired_session_exception=None,
                      session_key=None):
        """
        This method overloaded for now (java port).  TBD
        Two possible scenarios supported:
            1) All three arguments passed = session + ese + session_key
            2) Only session passed as an argument
        """
        if (expired_session_exception and session_key):
            try:
                self.on_change(session)
                msg = "Session with id [{0}] has expired.".\
                    format(session.session_id)
                logger.debug(msg)

                identifiers = session.get_internal_attribute('identifiers_session_key')

                mysession = session_tuple(identifiers, session_key.session_id)

                self.notify_event(mysession, 'SESSION.EXPIRE')
            except:
                raise
            finally:
                self.after_expired(session)
        elif not expired_session_exception and not session_key:
            self.on_change(session)

        # Yosai adds this exception handling
        else:
            msg = "on_exception takes either 1 argument or 3 arguments"
            raise ValueError(msg)