<div><div>Hi,</div><div><br></div><div>Am developing an nginx module. I get multiple cookies in a http</div><div>request. I need to extract individual cookie from the multiple cookies</div><div>that I get. How do I achive this?</div>
<div><br></div><div>Is there an api to extract individual cookie?</div><div><br></div><div>From what I understand:</div><div><br></div><div>+ The cookies are present in request->headers_in as array</div><div><br></div>
<div> cookies == request->headers_in->cookies</div><div><br></div><div>+ The length of this array is 1, even when we get multiple cookies.</div><div><br></div><div>+ Further investigation reveals that the element is a hash.</div>
<div><br></div><div> cookies->elts is a hash.</div><div><br></div><div> key is cookie</div><div> value is all cookies</div><div> eg:</div><div> key -> cookie</div><div> value -> "cookie1=value1;cookie2=value2;cookie3=value3"</div>
<div><br></div><div>+ So will I need to parse the cookie string in "value" to extract</div><div> individual cookies?</div><div><br></div><div> Or is there a api that will help in extract individual cookies.</div>
<div><br></div><div>+ I cannot use ngx_http_parse_multi_header_lines() as I may not always</div><div> know the name of the cookie (the cookie name may vary depending on</div><div> id).</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
</div><div><span class="Apple-tab-span" style="white-space:pre">T</span>hanks for your help.</div><div><span class="Apple-tab-span" style="white-space:pre"><br></span></div><div><span class="Apple-tab-span" style="white-space:pre">~</span> s</div>