WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. flywitness
    Member
    Posted 5 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
    Member
    Posted 5 years ago #

    Found it!
    wp-setting.php:
    $cookiehash = md5(get_option('siteurl'));

    now let me see.......

  3. flywitness
    Member
    Posted 5 years ago #

    Changed:

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

    to:

    $cookiehash = md5('poo');

    BINGO!!!!!

  4. flywitness
    Member
    Posted 5 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
    Member
    Posted 5 years ago #

    i dont know what happened but this doesn't work

    [gives up]

  6. taffeljohan
    Member
    Posted 5 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic