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 하면될텐데;?
하는법을 몰라서요;;ㄷㄷ.. 방법좀..
/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 폴더에서는 그 쿠키값이 없다는 소리겠죠.
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 폴더에서는 그 쿠키값이 없다는 소리겠죠.
/b/c/ 에도 쿠키를 읽어올수있게 하려면 어덯게 해야하나요?
메뉴얼에 써 있네요;;;
If set to '/', the cookie will be available within the entire domain.
If set to '/', the cookie will be available within the entire domain.