Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    2 websites, 1 cookie?

    Is it possible to have two websites read the same cookie using PHP?

    I currently have two sites, one has a forum, the other a utility I made. I would like for the utility website to be able to read cookes from my other site so I can see if people are logged in over there and customize the interface accordingly. Is this something which can be done?

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Cookies are domain specific --> only the domain that set them, should be allowed to read them (for obvious reasons)

    So if both your 'sites' share the same domain, eand have like a subdomain or so, then it should be possible. If they both have their own domain, then it should not be possible.

    But since you have a forum, i suppoe you have a db in place, so i would just keep that login-info in the db and check against that --> more universal + will always work, even if the sites are on a seperate domain.
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html


  •  

    Posting Permissions

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