views:

367

answers:

2

We have developed a stand-alone script on the same server as our Joomla 1.5 installation. We want to see if the user is logged into to Joomla before giving them access to the script. To do that, we want to cross reference the session_id from Joomla and then query the Joomla database to verify that the user is logged in.

At this point our standalone script looks like this, just to test whether we can access the session variables.

<?
session_start();
print_r($_SESSION);
?>

However, the session variable is empty and prints out an empty array. Does anyone know why we are unable to pass the session variables to the standalone script? Doing a print_r($_SESSION) from within the Joomla code works just fine.

A: 

Joomla is probably using a custom session handler.

See: http://www.php.net/manual/en/function.session-set-save-handler.php

Brad
+1  A: 

SEE "Joomla login session" tutorial:

Especially this part:

"Once the frame work is initialised you can start using Joomla session"

SEE ALSO http://stackoverflow.com/questions/1066676/custom-sessions-with-joomla

micahwittman