By ironj221 on
Here is what I'm doing in an external script:
chdir('./../');
require_once "./includes/bootstrap.inc";
drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION);
global $user;
echo $user->uid;What am I doing wrong? It always returns 0 as the uid. I even tried doing DRUPAL_BOOTSTRAP_FULL.
Any ideas?
Comments
Set
Set
$cookie_domain='example.com';explicitly in your settings.php file.Thanks, I'll give that a
Thanks, I'll give that a try.
By any chance does Drupal keep the UID in a cookie so that I don't even have to load the environment?
No, it doesn't, just a long
No, it doesn't, just a long session ID string.
$cookie_domain trick works
$cookie_domaintrick works like a charm..
By the way, since Drupal 6.17 things have changed and that should be
$cookie_domain='.example.com';with a front dot. (That works too in older versions.)