반응형
HTTP 요청에 여러 쿠키 헤더가 허용됩니까?
일반적으로 브라우저는 쿠키를 다음 Cookie과 같은 단일 헤더 로 그룹화합니다 .
Cookie: a=1; b=2
표준에서 다음과 같은 별도의 헤더로 전송할 수 있습니까?
Cookie: a=1
Cookie: b=2
아니면 항상 같은 줄에 있어야합니까?
주제에 대한 세부 사항을 찾는 동안이 페이지를 방문했습니다. HTTP State Management Mechanism, RFC 6265 의 인용문은 일을 더 명확하게해야합니다.
5.4. 쿠키 헤더
사용자 에이전트가 HTTP 요청을 생성 할 때 사용자 에이전트는 하나 이상의 쿠키 헤더 필드를 첨부하면 안됩니다.
실제로 여러 Cookie헤더를 사용하는 것이 금지 된 것 같습니다!
이제 다음을 지정하는 HTTP / 2 ( RFC 7540 ) 에서 허용 됩니다.
8.1.2.5. Compressing the Cookie Header Field
The Cookie header field [COOKIE] uses a semi-colon (";") to delimit
cookie-pairs (or "crumbs"). This header field doesn't follow the
list construction rules in HTTP (see [RFC7230], Section 3.2.2), which
prevents cookie-pairs from being separated into different name-value
pairs. This can significantly reduce compression efficiency as
individual cookie-pairs are updated.
To allow for better compression efficiency, the Cookie header field
MAY be split into separate header fields, each with one or more
cookie-pairs. If there are multiple Cookie header fields after
decompression, these MUST be concatenated into a single octet string
using the two-octet delimiter of 0x3B, 0x20 (the ASCII string "; ")
before being passed into a non-HTTP/2 context, such as an HTTP/1.1
connection, or a generic HTTP server application.
Therefore, the following two lists of Cookie header fields are
semantically equivalent.
cookie: a=b; c=d; e=f
cookie: a=b
cookie: c=d
cookie: e=f
참고URL : https://stackoverflow.com/questions/16305814/are-multiple-cookie-headers-allowed-in-an-http-request
반응형
'developer tip' 카테고리의 다른 글
| ON 조건없이 mysql JOIN을 사용하는 방법은 무엇입니까? (0) | 2020.09.22 |
|---|---|
| Java Eclipse : JAR로 내보내기와 실행 가능한 JAR로 내보내기의 차이점 (0) | 2020.09.22 |
| Gradle로 JaCoCo 커버리지 보고서 필터링 (0) | 2020.09.22 |
| Java의 ByteBuffer에서 바이트 배열을 가져옵니다. (0) | 2020.09.22 |
| JavaScript 또는 jQuery에서 HTML을 정규화하는 방법은 무엇입니까? (0) | 2020.09.22 |