Support » Fixing WordPress » Categories as sub-domains -> How to detect login in main domain?

  • Resolved Duke

    (@dukessa)


    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!

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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?

    Duke

    (@dukessa)

    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 🙂

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

    Fadere

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Categories as sub-domains -> How to detect login in main domain?’ is closed to new replies.