1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Sharing cookies between two URLs, one forum instance.

Discussion in 'XenForo Questions and Support' started by Phases, Oct 8, 2010.

  1. Phases

    Phases Active Member

    I hope this can be easily done and someone is willing to help me.

    I have two URLs, both pointing to the same forum instance. I have bought two licenses to accommodate this.

    It works fine except that if you go from one to the other you have to log in repeatedly. I would like to not have to do this and cookies go across the board.

    (ha, see what I did there? Across the board!)

    Is this easily done? Any advice appreciated.

  2. Mike

    Mike XenForo Developer Staff Member

    You can't share cookies between 2 entirely unrelated domains (without developing a complex system to support it, that is).
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Browser cookies cannot cross between different domain names. You will have to login for each domain name. This is a limitation of cookies and would be a problem no matter what forum software you use.
  4. Phases

    Phases Active Member

    Even if they reside on the same server? Using symlinks, etc?
  5. khurt

    khurt Member

    Like the others said, cookies are set on a per domain basis. You will be unable to set the cookie for androiduncensored.com from teatimeshow.com.

    However, you might be able to come up with something like this:
    • user logs in at Site A
    • site sets their cookie at Site A
    • site redirects user to Site B
    • site sets their cookie at Site B
    • site redirects user back to site A
    2 things to think about:
    • You'd probably need to also log out of both sites when the user clicks "logout"
    • Any information that is stored in the cookie after the user logs in could cause inconsistencies between the 2 domains
    Unless it's critical, I wouldn't bother with it.
  6. Phases

    Phases Active Member

    I guess I was hoping you could pass a session key back and forth rather than rely on a cookie stored on the users local machine.

    ...this really bums me out. Not critical, but a terrible annoyance as users come to the forum from one site - discover the second as intended - go check it out, then come back with the forum button in the navbar there.

Share This Page