2011-04-06 6 views
0

ovh 호스트의 cakephp에 인증 구성 요소에 문제가 있습니다. Cakephp Auth 구성 요소가 제대로 작동하지 않습니다.

내가 로그인

가있는 세션 변수가 설정되지 않은 : 인 print_r ($ this_session) 만 표시 :

Array ([Config] => Array ([userAgent] => [time] => 1302122401 [timeout] => 10)) 

이 문제의 이상한 부분, 때로는 작동하는지입니다 ... 나는 연결하는 데 사용 내 집에서 제대로, 내 직장에서 덜.

다음은 내가 사용하는 코드입니다. 정말 간단합니다. 한 app_controller : user_controller에서

<?php 
class AppController extends Controller { 
     var $components = array("Session","Auth"); 
     function beforeFilter() { 
       $this->Auth->fields = array('username' => 'name', 'password' => 'password'); 
       $this->Auth->loginAction = array('action' => 'login'); 
     $this->Auth->loginRedirect = array('controller' => 'discs', 'action' => 'hello'); 
     $this->Auth->logoutRedirect = '/'; 
       $this->Auth->loginError = 'Invalid name/password combination. Please try again'; 
     } 
} 

?> 

:

function login() { 
      } 

    function logout() { 
    $this->redirect($this->Auth->logout()); 
    } 

내가 세션 구성을 수정하려고 : - PHP를 시도하거나 케이크 관리 - 매체 낮은에서 보안 수준을 시도 - 변화에 노력을 세션 쿠키 이름 - checkAgent를 false로 설정하려고 시도했습니다.

아이디어가 있으십니까?

+0

필터를 사용하기 전에 모든 항목을 일시적으로 제거하고 사용해보십시오. 작동한다면. – Headshota

+0

부모 필터에서 모든 항목을 제거하면 기록되지 않습니다. 방금 Auth-> fields를 설정하면 이전과 동일하게 동작합니다. – dmn

답변

0

확실하지 않지만 코드가 이미 맞습니다. 'user_controller'파일 이름을 발견했습니다. users_controller 대신 user_controller가 있습니까? cakephp의 명명 규칙은 그러한 오류를 방지하기 위해 우리에게 정말로 중요합니다. 마지막으로 $this->Auth->loginAction = array('action' => 'login');을 삭제 해보세요.

관련 문제