php 쿠키 질문이요 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

php 쿠키 질문이요 정보

php 쿠키 질문이요

본문

/a/1.php
/a/3.php
/b/c/1.php

이렇게 있을때요..
/a/1.php 에서 쿠키를 refer 에 $_SERVER[REMOTE_REFERER]; 를 저장합니다.
- 여기까지는 되는데요..

/a/1.php 에서 쿠키저장하고 /a/3.php 로 넘어가요.
/a/3.php 안에서 /b/c/1.php 를 iframe 으로 불러옵니다.

/b/c/1.php 에서 쿼리에 저장을 하는데요.
쿠키 refer 값을 불러오면, 공백이네요.. iframe 이 문제인가요?
그럼 어떻게 불러와야하죠? document.cookie 하면될텐데;?
하는법을 몰라서요;;ㄷㄷ.. 방법좀..
  • 복사

댓글 전체

http://kr2.php.net/manual/kr/function.setcookie.php

setcookie($name, $value, $expire, $path, $domain, $secure, $httponly)
메뉴얼에서 $path에 대한 설명은 아래처럼 되어 있습니다.

The path on the server in which the cookie will be available on. If set to '/', the cookie will be available within the entire domain . If set to '/foo/', the cookie will only be available within the /foo/ directory and all sub-directories such as /foo/bar/ of domain . The default value is the current directory that the cookie is being set in.

대략 해석하자면 쿠키가 사용되는 경로를 말하며, 디폴트일 경우에는 현재 폴더로 셋팅된다...
즉, a 폴더에서 쿠키를 구울때 디폴트로 했다면 b 폴더에서는 그 쿠키값이 없다는 소리겠죠.
© SIRSOFT
현재 페이지 제일 처음으로