//登录成功存sessionyii::$app->session['names']=$names;
//取session$names=Yii::$app->session['names'];echo $names;
视图显示
<?php echo $_SESSION['names']?>