'Called at the end of the login process, just before letting
the player loose.
Args:
session (Session, optional): Session logging in, if any.
Notes:
This is called *before* an eventual Character\'s
`at_post_login` hook. By default it is used to set up
auto-puppeting based on `MULTISESSION_MODE`.'

def at_post_login(self, session=None):

    protocol_flags = self.attributes.get('_saved_protocol_flags', None)
    if (session and protocol_flags):
        session.update_flags(**protocol_flags)
    if session:
        session.msg(logged_in={})
    self._send_to_connect_channel(('|G%s    connected|n' % self.key))
    if (_MULTISESSION_MODE == 0):
        try:
            self.puppet_object(session, self.db._last_puppet)
        except RuntimeError:
            self.msg('The    Character    does    not    exist.')
            return
    elif (_MULTISESSION_MODE == 1):
        try:
            self.puppet_object(session, self.db._last_puppet)
        except RuntimeError:
            self.msg('The    Character    does    not    exist.')
            return
    elif (_MULTISESSION_MODE in (2, 3)):
        self.db._playable_characters = [char for char in self.db._playable_characters if char]
        self.msg(self.at_look(target=self.db._playable_characters, session=session))
