Multisite (MultiWP) - Single Sign on in 2.6 (6 posts)

  1. flywitness
    Posted 7 years ago #

    Is it possible to get cookies to behave in such a way as to allow one login to take effect across a whole domain?

    I have been trying to get this to work for some time now. I have:

    - ensured that AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, LOGGED_IN_SALT, AUTH_SALT and SECRET_KEY are identical accross all installs
    - define('COOKIE_DOMAIN', '');
    - define('COOKIEPATH', '/');

    in addition I have also tried:

    - define('COOKIE_DOMAIN', '.mydomain.com');
    - made db entry wp_options.secret the same accross all installs

    The cookie keys and values that wordpress creates seem to always have a unique, per install value which is a very long garbled code.

    I get the feeling that if i could get all my installs to create this same code, single sign on will work (I may be wrong). However, I can't find how WP creates these unique codes. No matter how I try to make my installs identical, they insist on having unique cookies.

    Can anybody shed any light on this? It's doing my head in!

  2. flywitness
    Posted 7 years ago #

    Found it!
    $cookiehash = md5(get_option('siteurl'));

    now let me see.......

  3. flywitness
    Posted 7 years ago #


    $cookiehash = md5(get_option('siteurl'));


    $cookiehash = md5('poo');


  4. flywitness
    Posted 7 years ago #

    actually, its probably a little bit more useful if you make the cookies unique for each domain:

    $cookiehash = md5($_SERVER['HTTP_HOST']);

    if you only have one domain, feel free to leave it as 'poo' or any other word that tickles your fancy.

  5. flywitness
    Posted 7 years ago #

    i dont know what happened but this doesn't work

    [gives up]

  6. taffeljohan
    Posted 6 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic