DIsplay Message when user is logged out
-
Hello,
I added code to your plugin to display a warning message whenever a new user tries to login concurrently. However, I can’t get the message to display consistently. Any ideas?
See code below:$session = pcl_get_current_session();
if ( $session[‘login’] === $newest ) {
wp_destroy_other_sessions();
echo “<script type=’javascript’>alert(‘Your account is currently logged in from another device. The other session will end now and the user will be logged out’);</script>”;/**
* Fires after a user’s non-current sessions are destroyed
*
* @since 0.3.0
*
* @param int $user_id ID of the affected user
*/
do_action( ‘pcl_destroy_other_sessions’, $user_id );} else {
wp_destroy_current_session();
/**
* Fires after a user’s current session is destroyed
*
* @since 0.3.0
*
* @param int $user_id ID of the affected user
*/
do_action( ‘pcl_destroy_current_session’, $user_id );}
}
- The topic ‘DIsplay Message when user is logged out’ is closed to new replies.