@click.command(u'destroy-all-sessions')
@click.option(u'--reason')
@pass_context
def destroy_all_sessions(context, reason=None):
 import frappe.sessions
 for site in context.sites:
  try:
   frappe.init(site=site)
   frappe.connect()
   frappe.sessions.clear_all_sessions(reason)
   frappe.db.commit()
  finally:
   frappe.destroy()

@ click . command ( u'destroy-all-sessions' ) @ click . option ( u'--reason' ) @ pass_context def destroy_all_sessions ( context , reason = None ) : import frappe . sessions for site in context . sites : try : frappe . init ( site = site ) frappe . connect ( ) frappe . sessions . clear_all_sessions ( reason ) frappe . db . commit ( ) finally : frappe . destroy ( )
clear sessions of all users .