wp_get_all_sessions() WordPress Function
The wp_get_all_sessions() function is used to retrieve all sessions for the current user. This function is useful for retrieving information about the current user's session, such as their last login time, IP address, and user agent.
wp_get_all_sessions() #
Retrieves a list of sessions for the current user.
Return
(array) Array of sessions.
Source
File: wp-includes/user.php
function wp_get_all_sessions() { $manager = WP_Session_Tokens::get_instance( get_current_user_id() ); return $manager->get_all(); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.0.0 | Introduced. |