Hi I am getting the following error message on my application, which is running in an iframe from a joomla application and getting the user details from joomla session:
Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in /home/sites/accstats.co.uk/public_html/libraries/joomla/session/handler/joomla.php on line 45 id:973
This is the code I am using, which has always worked fine for older versions of joomla, I am not a developer (just an amateur) so am unsure what the problem is.
define( '_JEXEC', 1 );
define( 'DS', DIRECTORY_SEPARATOR );
define('JPATH_BASE', "/home/sites/accstats.co.uk/public_html/" );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe = JFactory::getApplication('site');
$mainframe->initialise();
$user = JFactory::getUser();
if($user->id)
// log in
{
$_SESSION["UserID"] = $user->get("username");
$groups = $user->get('groups');
$_SESSION["GroupID"] = reset($groups);
$_SESSION["UserName"] = $user->get("name");
if ($user->get('isRoot')) $_SESSION["AccessLevel"] = ACCESS_LEVEL_ADMINGROUP;
else $_SESSION["AccessLevel"] = ACCESS_LEVEL_USER;
}
else
// log out
{
$_SESSION["UserID"] = "";
$_SESSION["AccessLevel"] = "";
$_SESSION["GroupID"] = "";
$_SESSION["UserName"] = "";
}
.DS.
before appending the next segment. – Elin