Skip to content
GitLab
Explore
Sign in
Commits on Source (1)
Increase debugging information for auth_cookie_bad_session_token
· f4ae1674
ale
authored
Mar 26, 2023
f4ae1674
Hide whitespace changes
Inline
Side-by-side
login-debug.php
View file @
f4ae1674
...
...
@@ -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'
);