In the recent 4.1 update WordPress introduced session management classes/functions/hooks.You can locate the “Logout of all other sessions” button your user profile in WP admin panel, click this button and you’ll be logged out of all other sessions. Other sessions would mean that you logged in from another computer, mobile phone/app etc.
This is an important update not only in terms of security and privacy but it also adds considerable options to expand the native CMS functionality, as WordPress now tracks sessions of logged in users, collecting information.
In this post we’ll add few lines of code to enable single logged in session per user in a WordPress site. Simply add this code in your theme functions.php file :
add_filter( 'authenticate','one_session_per_user', 30, 3 );