[英]CodeIgniter ion_auth with multiple website
我有兩個網站,並使用ion auth作為登錄系統
CI結構如下:
CI_BASE
- system
- application
- site1
- application
- config
- controllers
- view
- ...
- site2
- application
- config
- controllers
- view
- ...
現在我想使用site1作為主要成員頁面
但site2也可以讀取site1會話並將數據更新到服務器
site1 domain are:
http site1 domain are:
//1.mysite.com/
site2 domain are:
http site2 domain are:
如何連接具有相同身份驗證的兩個網站?
盡管不是一個好習慣,但是數據庫(如果您使用此方法)和會話配置必須相同。
文件:site1 / application / config.php,site2 / application / config.php
$config['sess_cookie_name'] = 'site_cookie'; // Important! Must be the same name in both sites
$config['sess_expiration'] = 7200;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = TRUE;
$config['sess_use_database'] = TRUE; // If you work with database
$config['sess_table_name'] = 'sessions'; // Important! Must be the same table
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
其余的工作與您的界面和前端一起使用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.