We have an intranet where users login and once logged in their details are stored in $_SESSION['i_user']. I want my module to check if users are already logged into the intranet, if they are then use the $_SESSION['i_user'] info to log then into drupal.

So i have started by trying to use the hook_init() hook. see below

function hook_init()
{
    var_dump($_SESSION);
    if($_SESSION['i_user'])
    {
         echo "user logged in";
    }
}

but the problem is that when i am logged into the intranet and i go to the drupal homepage i the hook_init() hook returns

array(0) { }

at the top of the page, indicating that the session data has been deleted......

is there any way i can access my session data?

Thanks in advance for the help

Comments

verbal@drupal.org’s picture

Did you get this figured out? because i'm having the same problem.