[英]How to make if Login in frontend also login in backen in Yii2?
嗨,我想問一下如何登錄功能,如果我在前端登錄,用戶也登錄Yii2的后端
我試圖從前端進行會話,但在后端,會話無法獲得。
在backend/config/main
添加:
'components' => [
'session' => [
// this is the name of the session cookie used for login on the backend
'name' => 'test',
],
]
name
必須與前端中的會話name
相同
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.