WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Categories as sub-domains -> How to detect login in main domain? (5 posts)

  1. The J
    Member
    Posted 4 years ago #

    Im using the WP Subdomains plugin, so that I can turn any category into a subdomain (mysite.com -> category.mysite.com)
    But now when im in the category (subdomain) or in a post in that category, it wont detect anymore than Im logged in, in the main site.

    How can I make it detect that I am logged in the main site, when I am in a category?

    For example, i made a category "animals", so now my category is accesible with animals.mysite.com
    But when Im inside animals.mysite.com, wordpress doesnt detect anymore that im logged in on mysite.com ... so i need to write again info for comments, and the Edit Post link doesnt show.

    I was looking at this post and this piece of code:

    define('COOKIE_DOMAIN', '.mysite.com');
    define('COOKIEPATH', '/');

    but Im not quite sure if it's what Im looking for.

    How can I fix this??

    Thank you!

  2. MichaelH
    Member
    Posted 4 years ago #

  3. The J
    Member
    Posted 4 years ago #

    Thanks for linking my other post.
    As this concerns the plugin WP Subdomains, but could also be used in other contexts, I thought that asking a general question too could be useful for anyone having the need to make wordpress port the login to subdomains as well.

    Anyone?

  4. The J
    Member
    Posted 4 years ago #

    Posting the solution to the issue, from the other thread.

    Add an option to your wp-config.php:

    define('COOKIE_DOMAIN', '.mydomain.com');

    Where mydomain.com is your domain name. Remember to add the preceeding dot (.) as this is what makes it work.

    REMEMBER TO FLUSH YOUR TEMP FILES, AS WELL AS THE COOKIES :)

  5. Fadere Made
    Member
    Posted 4 years ago #

    I wanted to thank you Dukessa for posting that. I was having problems with it as well. Greatly appreciate it!

    Fadere

Topic Closed

This topic has been closed to new replies.

About this Topic