Skip to content
Snippets Groups Projects
Commit f4ae1674 authored by ale's avatar ale
Browse files

Increase debugging information for auth_cookie_bad_session_token

parent e6a213bb
No related branches found
Tags v0.4.8
No related merge requests found
Pipeline #49273 passed
......@@ -37,6 +37,14 @@ add_action('auth_cookie_bad_hash', 'debug_login_auth_cookie_bad_hash');
function debug_login_auth_cookie_bad_session_token($cookie_elements) {
$username = $cookie_elements['username'];
$token = $cookie_elements['token'];
error_log("LOGIN: auth_cookie_bad_session_token: username={$username} token={$token}");
// Try to see if the validation fails because of session_tokens usermeta attribute.
$user = get_user_by('login', $username);
$manager = WP_Session_Tokens::get_instance( $user->ID );
$verifier = $manager->hash_token($token);
$sessions = $manager->get_sessions();
$session_names = implode(",", array_keys($sessions));
error_log("LOGIN: auth_cookie_bad_session_token: username={$username} token={$token} verifier={$verifier} sessions={$session_names}");
}
add_action('auth_cookie_bad_session_token', 'debug_login_auth_cookie_bad_session_token');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment