Support » Plugins » [Plugin: WordPress MU Domain Mapping] Unknown logout key

  • ssandison



    I have upgraded to 0.5 from 0.4.3. However since I have done this I get an error when attempting to log out of WordPress admin area. I get the following error:

    Unknown logout key

    I had a look in the wp_domain_mapping_logins table which I guessed would be where the code is looking for the “logout key”. Here is a dump of the table:

    mysql> select * from wp_domain_mapping_logins;
    | id | user_id | blog_id | t |
    | | 0 | 2 | 0000-00-00 00:00:00 |
    1 row in set (0.00 sec)

    Also I have made changes to the code to allow www. prefix (similar to however I don’t think this is causing the problem?

    Does anyone have any ideas why this would be happening?



Viewing 12 replies - 1 through 12 (of 12 total)
  • Can you debug the plugin? Add an error_log around line 460 (in the logout check) and then work backwards. It could be because you modified it but I can’t be sure because you’re using different code to what I have …

    Sorry donncha I forgot all about this issue because I was working on something else but I will have a go at debugging and will also check to see if I get the same problem with an unmodified code base.



    I cannot login on any mapped domain:

    [Tue Dec 29 10:51:15 2009] [error] [client] WordPress database error Table ‘mypencil.wp_domain_mapping_logins’ doesn’t exist for query SELECT * FROM wp_domain_mapping_logins WHERE id = ‘a57ef13ca0b45b83cb29775a9775c835’ AND blog_id = 2 made by require, require_once, do_action, call_user_func_array, remote_login_js, referer:

    I get the “Unknown login key” whenever I attempt to login; this is after upgrading to 0.5.

    Oops, the table wp_domain_mapping_logins does not exist. Wonder where that comes from?

    Ok, figured it out — You have to fun the setup from the Site Admin -> Domain mapping page. I never saw a notice for that, but ran across it in the readme.txt file (not very useful if you automatically update the plugin, IMHO).


    I have also been experiencing this error. Here is current setup:

    WordPress MU 2.9.2
    WordPress MU Domain Mapping 0.5.1

    The setup is working correctly and I am able to make different “blogs” appear on different domains… but…

    When Administrators log in and edit their blogs and make changes, they try to view the changes by clicking “View Site” at top of page. They unfortunately get the following error (instead of their site):

    “Unknown login key”

    Here is the HTML source of the page that is displayed:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <!-- Ticket #11289, IE bug fix: always pad the error page with enough characters such that it is greater than 512 bytes, even after gzip compression abcdefghijklmnopqrstuvwxyz1234567890aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz11223344556677889900abacbcbdcdcededfefegfgfhghgihihjijikjkjlklkmlmlnmnmononpopoqpqprqrqsrsrtstsubcbcdcdedefefgfabcadefbghicjkldmnoepqrfstugvwxhyz1i234j567k890laabmbccnddeoeffpgghqhiirjjksklltmmnunoovppqwqrrxsstytuuzvvw0wxx1yyz2z113223434455666777889890091abc2def3ghi4jkl5mno6pqr7stu8vwx9yz11aab2bcc3dd4ee5ff6gg7hh8ii9j0jk1kl2lmm3nnoo4p5pq6qrr7ss8tt9uuvv0wwx1x2yyzz13aba4cbcb5dcdc6dedfef8egf9gfh0ghg1ihi2hji3jik4jkj5lkl6kml7mln8mnm9ono -->
    <html xmlns="" dir="ltr">
    	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    	<title>WordPress &rsaquo; Error</title>
    	<link rel="stylesheet" href="" type="text/css" />
    <body id="error-page">
    	<p>Unknown login key</p></body>

    It appears the only way they can edit their blogs and then view the changes LIVE are using 2 different web-browsers with separate SESSIONs.

    Does anyone know of a fix? Is this a bug?

    Thanks in advance.

    Check your DB and make sure the domain_mapping_logins table is set up properly.

    Same here.

    WPMU 2.9.2 and domain mapping 0.5.1 -> “Unknown login key” message after logout.

    My domain mapping logins table has only one record:

    id user_id blog_id t
    (empty) 0 35 0000-00-00 00:00:00

    pretty strange since I’m running 100+ blogs?

    Just noticed this as well, Unknown logout key,,, WP 3.0 latest version of the plugin

    Had the same problem with my site (wp 3.0).
    Strangely enough what solved it was changing the “id” field in “wp_domain_mapping_logins” into an auto-increment int (from varchar).
    this table only contains one line that doesn’t change after logins/logouts (maybe it will change when I setup a new blog), but no more “Unknown logout key”.

    btw, I really love this plugin.

    I have two wpmu sites. One is a test site and is a fresh wpmu 2.9.2 install, the other is the production site that was running an older version of wpmu before being upgraded to 2.9.2.

    It is only the upgraded production site that has the problem noted by DrLightman (the weird single row in the in the wp_domain_mapping_logins table with an user_id = 0 when clearly no such user id exists). When I deleted that row in phpmyadmin, it seemed to fix the issue. So I wrote a little addition to the logout function in the domain_mappings.php plugin file. I checked for a row with a user_id of 0 and deleted it if it exists.

    That didn’t end up truly fixing the problem though. I started to get the weird “unknown logout key” error again. The worst part was the error page shows the url of my main site, which is not what I want my users to see (they should see their site’s url for pete’s sake).

    The final fix was to replace the error message call and make it redirect to the login page. I thought maybe this would leave the user logged in, but I tested it and it doesn’t (it makes you login again to view the admin area). Beautiful!

    So in conclusion, just add a few lines to the domain_mapping.php file. Search for “unknown logout key” in that file and you’ll see the code inside the logout action that you need to replace. Here’s the snippet to use instead (in the end it’s just five extra lines of code):

    I’ve added a php comment of //+ to the ends of the lines I added so you can see exactly what’s changed. You can remove those comments of course, or leave them in for reference.


    Thanks for sharing wshq.

    But I just noticed that I had the “Unknown login key” not “Unknown logout key”.

    What would that mean? It appeared after I changed host, so changing the ip. Maybe the cookies are messed up?

    I also like to add if this happens trying to load the homepage of the blog, not even trying to login or logout. Why?

    And my $wpdb->dmtablelogins is still empty or presentes a single row with user_id = 0.

    This error doesn’t happen in a browser in which I don’t usually login or logout, but only in Firefox where to I login in the admin.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: WordPress MU Domain Mapping] Unknown logout key’ is closed to new replies.