dongmeng0317 2019-08-09 02:21
浏览 109

如何从Yii2应用程序进行身份验证后,允许自动登录Yii1应用程序

I am creating a main hub using Yii2 as a base, my goal is to ask users to login into the Yii2 app and store a session into a certain folder. Then inside the Yii2 app there will be links into older Yii1 apps that use stored session in a folder.

I have successfully made both apps start to store sessions into a specific folder in C://sessions but to no avail i couldn't get the Yii1 app to recognize the session that the Yii2 app has created.

My question is how do i allow auto login into the Yii1 app after the user has logged into the Yii2 app?

The configs below have not been successful as i cant seem to get the Yii1 app to recognize the session created by the Yii2 app. Is it even possible for them to share the same session?

Any help is greatly appreciated.

Yii2 - web.php

'components' => [
        'session'=>[
            'class'=>'yii\web\Session',
            'savePath'=>"C:\sessions",  //change session path
            'timeout' => 600,
            'cookieParams'=>[
                'domain' => $_SERVER['HTTP_HOST'],
                'expire' => 600
            ],
        ],

Yii1 - main.php

'components'=>array(
        'session'=>array(
            'class'=>'CHttpSession',
            'savePath'=>"C:\sessions",  //change session path
            'cookieMode'=>'allow',
            'timeout' => 600,
            'cookieParams'=>array(
                'domain' => $_SERVER['HTTP_HOST'],
                'expire' => 600
            ),
        ),
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器