Got an issue that I am getting a difficult time getting began on. Not really a large PHP guy so unsure how to start really.

Things I have is. I've got a web application running on application.xxx.com this. This will be our private application that our clients use.

We're assembling a understanding base in wordpress of methods our software works, help files, etc... this really is personal data. For business reasons this wordpress operates on kb.xxx.com and should be there.

Things I am doing presently happens when a person authenticates at application.xxx.com I'm setting a website level cookie with a few authentication information. This is effective.

What I have to have happen is around the wordpress aspect if your user browses to kb.xxx.com and doesn't have our parent domain cookie, they're delivered to a burglar error url somewhere. This needs to happen server side, can't do that in JS because it is not secure enough.

What files would I edit within the wordpress install to get this done type of look for every request? Also how do you look into the parent level cookie in PHP.

Thanks ahead of time!

Do this WordPress Action

You can test this process. Just add the title of the cookie and add this code for your Functions.php file, situated at the bottom of the theme file. If isn't there you can easily create one.

Paste code to your Functions.php file

function has_auth_cookie(){ 
    // See if cookie is set
    if(isset($_COOKIE['cookie_name'])){
        // Do nothing 
    }else{
        // Do Something else
        header('Location: http://www.example.com/');
    }
}
add_action('template_redirect', 'has_auth_cookie');

Conclusion

WordPress includes a great Action and Filter system making adding code simple as cake. Using the filters and actions you can preserve your code nice clean rather than tossing PHP on your template files. This process can survive WordPress core updates too. That is the only method to go in case your using WordPress.

Here's their email list of accessible actions for WordPress you can test rather than 'template_redirect': http://codex.wordpress.org/Plugin_API/Action_Reference