I&#39;m writing a module to add a cookie into r-&gt;headers_in.cookies, that the php-cgi server behind can get it from $_COOKIE. But there&#39;s a problem which I could not resolve.<br>If there&#39;s no cookie sent from client, I just create a new <i><b>r-&gt;headers_in.cookies.elts</b></i> to store my cookie for php-cgi behind as this:<br>
<i><b>ngx_table_elt_t* cookie = (ngx_table_elt_t*)ngx_pcalloc(r-&gt;pool, sizeof(ngx_table_elt_t));<br>cookie = (ngx_table_elt_t*)ngx_array_push(&amp;r-&gt;headers_in.cookies);</b></i><br>Then I stroe my cookie to <i><b>cookie</b></i>, but the php-cgi can not get cookie from $_COOKIE.<br>
However, if client already has cookie and send them to server, I can modify <i><b>r-&gt;headers_in.cookies.elts</b></i> to add my cookie to it, and the php-cgi behind can get my cookie from $_COOKIE.<br>My module is registed in <i><b>NGX_HTTP_PREACCESS_PHASE</b></i>.<br>
I really don&#39;t know how to resolve it<img goomoji="33A" style="margin: 0pt 0.2ex; vertical-align: middle;" src="cid:33A@goomoji.gmail">. Who can help me? Thank you very much!!<img goomoji="349" style="margin: 0pt 0.2ex; vertical-align: middle;" src="cid:349@goomoji.gmail"><br>