wp_get_all_sessions()WP 4.0.0

Retrieve a list of sessions for the current user.

No Hooks.

Return

Array. Array of sessions.

Usage

wp_get_all_sessions();

Changelog

Since 4.0.0 Introduced.

Code of wp_get_all_sessions() WP 5.9.3

function wp_get_all_sessions() {
	$manager = WP_Session_Tokens::get_instance( get_current_user_id() );
	return $manager->get_all();
}