admin管理员组文章数量:1123931
I'm having a problem with nonce verification. The theme I'm using has an AJAX login form that has nonce as a hidden field. It normally goes to my account page after a logout, and I can re-login from there or go back to home page and use the AJAX login form again, but I want it to go to the homepage after a logout, so I added the following action hook:
add_action('wp_logout','auto_redirect_after_logout');
function auto_redirect_after_logout(){
wp_redirect( home_url() );
exit();
}
This is were the problem started. When I logout and am redirected to the homepage, using the AJAX login form again gives me an error - which I found out to be a nonce verification failure. If I refresh the page or navigate to another page before logging in, everything works fine. Your help in fixing this problem is much appreciated.
本文标签: ajaxNonce verification problem when logging in after a logout
版权声明:本文标题:ajax - Nonce verification problem when logging in after a logout 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736609959a1945419.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论