CI 묻고 답하기

제목 csrf_cookie 관련해서 문의드립니다.
글쓴이 온더탑 작성시각 2014/07/25 14:14:21
댓글 : 2 추천 : 0 스크랩 : 0 조회수 : 11481   RSS
오늘도 비가 많이 내릴 것 같은 날이네요.

csrf 관련해서 문의 드립니다.

아래와 같이 보안 이슈 발생했다고 고쳐달라고 피드백이 왔는데

csrf 쿠키 expire 설정값을 안넣으면 자동으로 세션쿠키로 바뀌니 그렇게 하라라는거 같은데 맞나요.

이게 가능한건지 알려주셨으면 합니다.

From a coding perspective, the only distinction between a session cookie and a persistent cookie is the 'Expires=' tag that specifies when a persistent cookie should expire. If a cookie has no 'Expires=' tag, then it is automatically interpreted as a session cookie. Removing the expiration date from the code that sets the cookie will change it to a session cookie.


$config['csrf_protection'] = TRUE;
$config['csrf_token_name'] = 'csrf_token';
$config['csrf_cookie_name'] = 'csrf_cookie';
$config['csrf_expire'] = 7200;

콘피그 설정값은 위와 같습니다.

csrf_expire 값을 0으로 바꿔도 session으로 변경되지 않던데 웅 어찌해야 할까요.
 다음글 URL 라우터 질문 (3)
 이전글 서버이전이후 CI가 먹히지않습니다. (6)

댓글

변종원(웅파) / 2014/07/25 15:10:31 / 추천 0
csrf는 그냥 쿠키를 씁니다. 0으로 바꾼다고 세션쿠키로 바뀌는게 아닙니다.

프로그램 돌려서 나온 일반적인 문구를 보낸거 같은데요?
letsgolee / 2014/07/26 19:06:09 / 추천 0
$config['sess_expire_on_close']    = TRUE;