It would probably work with some changes, but you're going to run into name collisions just trying to use it like it is because the supplied kwarg is session
.
if currentValue.value > 2:
all_sessions = system.perspective.getSessionInfo()
for user_session in all_sessions:
if user_session.id == session.props.id:
page_ids = user_session.pageIds
for page_id in page_ids:
system.perspective.navigate(page="/", sessionId=user_session.id, pageId=page_id)