대형 포탈들이나 서비스 업체들에서는 세션을 사용할 수 없도록 정책을 정해놓은 곳들이 있다. 보안이나 성능 상의 위험을 막고자 함이다. 이 때, 암묵적인 사용금지 뿐만이 아니라 서버 상에서 세션 사용 자체를 막아버린 경우가 있는데, 이런 경우에 CakePHP는 문제를 일으킬 수 있다.
CakePHP에서 Session lib[fn]/cake/libs/session.php[/fn]와 이를 상속받은 Session component [fn]cake/libs/controller/components/session.php [/fn] 을 이용해 세션을 처리한다.
세션에 대한 설정은 core.php에서 이루어진다. core.php[fn]/app/config/core.php[/fn]는 CakePHP와 관련된 환경 변수들을 세팅해 두는 곳이다. core.php에서 AUTO_SESSION를 false로 해 둔다고 해서, 세션을 아예 사용하지 않는 것은 아니다.
어쨋든 Session lib가 호출되고, __startSession 메소드에서 session_start()를 호출하게 된다.
이건 버그라고 보기 힘든 면도 있지만.. 어쨋든 원인은 Session component를 강제로 항상 호출하는데 있다. /cake/libs/controller/component.php 파일에서 58번째 줄을 보면, controller에서 세션 컴포넌트를 항상 강제로 호출을 하는데, 이를 주석처리 하면 된다.
[code] function init(&$controller) { $this->__controller =& $controller; if ($this->__controller->components !== false) { $loaded = array(); // $this->__controller->components = array_merge(array('Session'), $this->__controller->components); $loaded = $this->__loadComponents($loaded, $this->__controller->components); [/code]



