I'm pulling my hair out trying to figure this one out. I can't get the Bootstrap to work properly when outside of the Drupal dir. It works fine if I run this code in the Drupal dir, but up one level doesn't work.
My Drupal path is /public_html/drupal/. The script I'm running is in /public_html.
$user is not returning the logged in user. I've made sure it's not a cross-domain issue (i.e. www.domain.com vs. domain.com).
chdir('/path/to/drupal');
include_once('./includes/bootstrap.inc');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
global $user;
if ($user->uid) {
print "Logged in";
} else {
print "Logged out";
}