Forums

How can I logout of a wordpress site using a link from another web app? (1 post)

  1. jlamerto
    Member
    Posted 3 months ago #

    I have been looking for a way to logout of a wordpress site from a link on another web app that lives in a subdir outside of wordpress.

    If the link points to:
    http://my.domain.net/wp-login.php?action=logout&redirect_to=http%3A%2F%2Fmy.domain.net/

    I get the WordPress Failure Notice page:
    "You are attempting to log out of My Domain"
    "Do you really want to log out?"

    Clicking on the link does delete the cookies but the Failure Notice page remains and I need it to redirect.

    I managed to get it to redirect correctly by adding to my functions.php

    function my_logout_url() {
    	return 'http://my.domain.net/wp-login.php?action=logout&redirect_to=http://my.domain.net/&loggedout=true';
    }
    add_filter('logout_url', 'my_logout_url');

    But this doesn't logout the user.

    Anyone have any ideas?
    Thanks.

Reply

You must log in to post.

About this Topic

Tags