[development] global $user unavaialable?

David Metzler metzlerd at metzlerd.com
Fri Mar 20 18:02:05 UTC 2009


I'm working on implementing a new cas_server module that allows  
drupal accounts to be used as a single - sign on source.  I have a  
drupal 5 site issues a redirect to a drupal 6 site, and when I  
redirect to that page I don't find that the $user global is  
populated.  Is there some function or include that I should b calling  
to make sure that this data is there?

Code snippet that isn't returning correct data.

global $user
if ($user->uid) {
   drupal_set_message('user logged in');
}
else {
   drupal_set_message('User not logged in');
}

Note that if I click on any other link in the drupal page.  I show as  
being logged in, but the redirect to this page does not load the  
$user variable.

Developing against drupal 6.10



More information about the development mailing list