Posted on 2009/01/02 10:19
Filed Under Development/PHP

a.site.com, b.site.com 처럼 서브도메인을 가진 경우 두 도메인 사이에 세션을 공유해야할경우가 있다. 예를 들어 a.site.com에 로그인한후에 b.stie.com에 로그인했을때도 동일하게 로그인한 상태여야 하는것이다. 이것은 php.ini 설정에서 다음과 같이 수정하여 해결할수 있다.
session.cookie_domain = ".site.com"

혹은 PHP코드에서 직접
ini_set('session.cookie_domain', '.site.com');
session_regenerate_id();

함으로써 해결할수 있다.
2009/01/02 10:19 2009/01/02 10:19

트랙백 주소 : http://www.takeone.pe.kr/trackback/211

Counter

· Total
: 361236
· Today
: 56
· Yesterday
: 89