'Sets the current session id for the logged-in user.
If session_id doesn\'t match the existing session,
deletes the old session object.'

def set_login_session(self, session_id=None):

    meta = self.get_meta()
    old_login = meta.get('session_id', None)
    if old_login:
        SessionStore(session_key=old_login).delete()
    meta['session_id'] = session_id
    self.set_meta(meta)
    self.save()
