SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Somewhere in Indiana
    0 Post(s)
    0 Thread(s)

    Need to check a cookie with JS, but run PHP code

    Long story short, I have 2 sites.

    1 site sets a cookie on your machine when you have logged in.

    The other site is a wordpress blog. In the index.php (at the root level), I wanted to basically shield the site from running if this cookie is not found on their machine. If it is, the blog will run like normal.

    Is there a way I can do this without doing a bunch of redirects or form postings?


  2. #2
    SitePoint Addict ALL's Avatar
    Join Date
    Oct 2005
    South Dakota
    1 Post(s)
    0 Thread(s)
    depending on how you set it up, you should beable to just do something like: <-- that would be the main site... <-- this would be the blog or whatever

    depending on how the cookies are setup, you should beable to just set the domin to or which will cause it to only send the associated cookies. but if you set the cookies domin like this: it will send it no matter what.

    If they are on completely different sites you shouldnt neeed to worry about it,
    Did I help you?
    You can repay me, support one of my projects (no money needed):
    JavaScript Wiki, Another Web Forum, Paranormal Site


Posting Permissions

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