'Server wants to save data to the portal, maybe because it\'s
about to shut down. We don\'t overwrite any sessions here, just
update them in-place.
Args:
serversessions (dict): This is a dictionary
`{sessid:{property:value},...}` describing
the properties to sync on all sessions.
clean (bool): If True, remove any Portal sessions that are
not included in serversessions.'

def server_session_sync(self, serversessions, clean=True):

    to_save = [sessid for sessid in serversessions if (sessid in self)]
    for sessid in to_save:
        self[sessid].load_sync_data(serversessions[sessid])
    if clean:
        to_delete = [sessid for sessid in self if (sessid not in to_save)]
        for sessid in to_delete:
            self.server_disconnect(sessid)
