samedi 29 novembre 2014

Getting logout confirmation page despite nonce


I implemented an Ajax login on my site, and that part works great, but I'm having issues with the logout.


For the logout, I'm using the default link:



<?php echo wp_logout_url( home_url() );?>


But when I click on it, sends me to a confirmation page "You are attempting to log out of My Site Do you really want to log out?".


I've compared the links, and the link in the confirmation page is identical to the link I'm using in my template.


I'm guessing it has to do with the Ajax login, because it only happens when I click logout on the same page where I just logged in. If I go to a different page, the logout works fine.


Must I refresh the page after login? Is there a workaround, so I can keep my Ajax, and avoid redirecting after login?





Aucun commentaire:

Enregistrer un commentaire