Jump to content

Yii2 and Invision Suite Single Sign-on

Ivo Pereira

Recommended Posts


I've discovered that using second option of Single Sign-on implementation (https://community.invisionpower.com/4docs/advanced-usage/development/single-sign-on-sso-r98/) leads me to a session problem.

I am using a PHP framework named Yii2 Framework (www.yiiframework.com), and I've find out that the using the following snippet from the docs, do cause some conflicts regarding the framework session, as if the IPS Session would overwrite the framework session.



class SiteController extends Controller {

    public function actionIndex() {


        // For example, if I would set these values in Session
        // they will not be remembered in next page
        $member_id = \IPS\Member::loggedIn()->member_id;
        $member_username = \IPS\Member::loggedIn()->name;
        $member_email = \IPS\Member::loggedIn()->email;
        echo $member_id . '<br>';
        echo $member_username . '<br>';
        echo $member_email . '<br>';
        return $this->redirect( Url::to(['/test']) );


Is there any method I could use to stop overwriting the session? Or use the autoloader somehow?

In the IPS3 version, I was able to achieve it without problems by changing the autoloader order:


require_once( '../initdata.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );/*noLibHook*/
$registry = ipsRegistry::instance();

// [...]


Any ideas?

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...