I've set up my WordPress to look like the rest of my site now and its working very well. I have a small script which users log in with - either saving a cookie or a session to the computer (if they don't tick "Remember Me".)
This works fine on all my other pages, basically at the top of the page it looks to see if the user has a session or cookie - if not it dumps them back to the homepage.
I've put the same script at the top of the main index.php in WordPress. It works great if its a cookie, but for some reason if a session is set it determines correctly that a session is set but then closes the session after taking the user to the main weblog. Is there anywhere in the WordPress code that closes all active sessions - I can't seem to find it?
The script I use is this:
session_start();
if ( !isset($_COOKIE['peanutcookie']) AND !isset($_SESSION['peanutsession']) )
{
$errmsg = 1;
header('Location: \errorbox.php?errcode='.$errmsg);
exit;
} else {
/* Short and sweet */
define('WP_USE_THEMES', true);
require('./wp-blog-header.php');
}
Thanks for your help!