Stay logged in

Is there a way to have users stay logged in across sites rather than having to log in individually to each site? Maybe have it store a cookie or something – not too sure?

Thanks.

  • aecnu
    • WP Unicorn

    Greetings creativ3group,

    Thank you for this great question and a significant item to bring up.

    Indeed there is a cookie involved.

    Have you indeed used the User Synchronization plugin and users still need to login to each sub site?

    Please advise.

    Cheers, Joe

  • Tyler Orr
    • Site Builder, Child of Zeus

    Yes, I did the sync initially and the cookie feature didn’t seem to be working.

    Following a tutorial I found, I installed the ‘root cookie’ plugin to my site and added a cookie script to my wp-admin on both sites and it appears to be working now.

    I would obviously like this plugin to do all of that by itself – so with that in mind, I couldn’t seem to get the different sites talking to each other via login and logout like I seemed to have acheive with the root cookie plugin.

  • aecnu
    • WP Unicorn

    Greetings creativ3group,

    Thank you for the additional input, it is certainly appreciated.

    I did check out the plugin you suggested and it looks great.

    I even added it to my personal repository and it certainly sounds like a useful customization to the plugin.

    Therefore I will move this ticket to the feature requests section and alert the lead developer @cole of the request.

    Cheers, Joe

  • Tyler Orr
    • Site Builder, Child of Zeus

    Here is the script I added if you want to take a look at it as well for future reference:

    if(substr_compare($_SERVER['HTTP_HOST'], 'your-domain.com',
    -strlen('your-domain.com'), strlen('your-domain.com')) == 0) {
    // Define Cookie Domain for mydomain Sites
    define('COOKIE_DOMAIN', 'your-domain');
    // Set the Cookie Hash to something constant for mydomain Sites
    // This should allow single signon if they have subscribed to the services
    // This hash must then be used for the cookies themselves
    define('COOKIE_HASH', md5('mydomain.com auth services'));
    define('AUTH_COOKIE', 'wordpress_'.COOKIE_HASH);
    define('SECURE_AUTH_COOKIE', 'wordpress_sec_'.COOKIE_HASH);
    define('LOGGED_IN_COOKIE','wordpress_logged_in_'.COOKIE_HASH);
    define('TEST_COOKIE', 'wordpress_test_cookie');
    }

    I believe this is what did the trick for me but who knows! Would love to see this as a future feature of this plugin.

    Thanks!

  • aecnu
    • WP Unicorn

    Greetings creativ3group,

    Thank you for bringing this significant issue to our attention.

    Yes please do create a new ticket for this separate issue due to we have this now marked as a feature request and this other may indeed be a bug which would have a different priority.

    For your convenience feel free to copy and paste any relevant information from this ticket into the new ticket.

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.