def clear_all_sessions(reason=None):
 frappe.only_for(u'Administrator')
 if (not reason):
  reason = u'Deleted All Active Session'
 for sid in frappe.db.sql_list(u'select sid from `tabSessions`'):
  delete_session(sid, reason=reason)

def clear_all_sessions ( reason = None ) : frappe . only_for ( u'Administrator' ) if ( not reason ) : reason = u'Deleted All Active Session' for sid in frappe . db . sql_list ( u'select sid from `tabSessions`' ) : delete_session ( sid , reason = reason )
this effectively logs out all users .