Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2005
    fremont, CA

    addon domain + cookies

    I'm going to setup an addon domain to my primary domain so i can share databases (ie logins) for both domains.

    Since the addon domain is just a subdirectory of the primary, could i call a function in a script located in the primary domain (parent directory = public_html) that checks if a cookie is set for the primary domain and send that info back to the addon domain?

    I'm not sure how the browser or apache will treat the domain when its crossing the two domains, meaning will the browser think that its still in the addon domain when its executing the script to get the cookie? If so, it probably wont give me access to the cookie information.

    Basically i want users to seamlessly transfer between domains, so that they dont have to login in both areas.

    Thanks in advance.

  2. #2
    Let's say your main domain is:

    As far as I know, the only way the cookies can be shared is if your addon domain has the address of:

    For this case, since the domain is stil the same ( the cookies can be easily shared.

    One point to rememberis that client browsers are the one who determines whether or not a cookie should be sent.
    Submit your site to Asia Web Directory and get it known to the world.

  3. #3
    if you just plainly set cookie, your cookie will not be shared by subdomains.
    i.e cookie for can not be used for

    if you specificlaly set domain to be when sending cookie, then yes, it can be shared.

    sharing cookie between domains is possible too, I don't know how to do it, but someone else sure do.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts