We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using php in an iframe. I was previously able to get the user id with
define( '_JEXEC', 1 ); define( '_VALID_MOS', 1 ); define( 'JPATH_BASE', realpath(dirname(FILE).'/..')); define( 'DS', DIRECTORY_SEPARATOR ); require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' ); require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' ); $mainframe =& JFactory::getApplication('site'); $mainframe->initialise(); $session =& JFactory::getSession(); $user = JFactory::getUser();
but since upgrading, I get a "Failed to start the session because headers have already been sent" on pages that were working fine before.
The text was updated successfully, but these errors were encountered:
Can you test this 943f2e9 fix please? I think it's a session bug we just fixed
Sorry, something went wrong.
since the code posted seems to have been cropped by github, just to test, tried 3.5.0 without any patch with the following code and it worked.
To test, i created a file in the joomla root folder test.php with the following content
test.php
<?php define( '_JEXEC', 1 ); define( '_VALID_MOS', 1 ); define( 'JPATH_BASE', realpath(dirname(__FILE__))); define( 'DS', DIRECTORY_SEPARATOR ); require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' ); require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' ); $mainframe = JFactory::getApplication('site'); $mainframe->initialise(); $session = JFactory::getSession(); $user = JFactory::getUser(); // dump values var_dump($session); var_dump($user); ?>
I am closing this at this time due to lack of response
The answer though is you need to call $session->initialise
No branches or pull requests
Steps to reproduce the issue
Using php in an iframe. I was previously able to get the user id with
define( '_JEXEC', 1 );
define( '_VALID_MOS', 1 );
define( 'JPATH_BASE', realpath(dirname(FILE).'/..'));
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
$session =& JFactory::getSession();
$user = JFactory::getUser();
but since upgrading, I get a "Failed to start the session because headers have already been sent" on pages that were working fine before.
The text was updated successfully, but these errors were encountered: