Answer has been updated because don’t need to write function, only use wp_destroy_all_other_sessions
function with init
like this
add_action('init', 'wp_destroy_all_other_sessions');
Developed its plugin and publish on WordPress Download here :One Active session