def please_reset_handler(spawn, session):
    """ Handles the router asking to be reset before booting. """
    if not session.get('please_reset_seen'):
        spawn.log.debug('The device has asked to be reset.')
        session['please_reset_seen'] = True
        if session.get('rommon_count'):
            _ = session.pop('rommon_count')
