바

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 하면될텐데;?
하는법을 몰라서요;;ㄷㄷ.. 방법좀..
|

댓글 3개

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 폴더에서는 그 쿠키값이 없다는 소리겠죠.
/b/c/ 에도 쿠키를 읽어올수있게 하려면 어덯게 해야하나요?
메뉴얼에 써 있네요;;;
If set to '/', the cookie will be available within the entire domain.
댓글을 작성하시려면 로그인이 필요합니다.

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

+
제목 글쓴이 날짜 조회
10-02-08 조회 1,051
10-02-08 조회 1,055
10-02-08 조회 3,658
10-02-08 조회 3,595
10-02-08 조회 3,112
10-02-08 조회 1,607
10-02-08 조회 1,311
10-02-08 조회 3,686
10-02-07 조회 2,534
10-02-07 조회 1,299
10-02-07 조회 1,677
10-02-07 조회 1,626
10-02-07 조회 1,507
10-02-07 조회 1,690
10-02-07 조회 2,649
10-02-07 조회 1,609
10-02-07 조회 1,631
10-02-07 조회 1,881
10-02-07 조회 1,634
10-02-07 조회 1,642