A problem with modifing r->headers_in.cookies

Charles Tien spirittf at gmail.com
Tue May 4 08:35:34 MSD 2010


No one can help me? :(

On Sun, May 2, 2010 at 11:37 AM, tianfeng <spirittf at gmail.com> wrote:

> I'm writing a module to add a cookie into r->headers_in.cookies, that the
> php-cgi server behind can get it from $_COOKIE. But there's a problem which
> I could not resolve.
> If there's no cookie sent from client, I just create a new *
> r->headers_in.cookies.elts* to store my cookie for php-cgi behind as this:
> *ngx_table_elt_t* cookie = (ngx_table_elt_t*)ngx_pcalloc(r->pool,
> sizeof(ngx_table_elt_t));
> cookie = (ngx_table_elt_t*)ngx_array_push(&r->headers_in.cookies);*
> Then I stroe my cookie to *cookie*, but the php-cgi can not get cookie
> from $_COOKIE.
> However, if client already has cookie and send them to server, I can modify
> *r->headers_in.cookies.elts* to add my cookie to it, and the php-cgi
> behind can get my cookie from $_COOKIE.
> My module is registed in *NGX_HTTP_PREACCESS_PHASE*.
> I really don't know how to resolve it[?]. Who can help me? Thank you very
> much!![?]
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx-devel/attachments/20100504/f90fb71d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 912 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx-devel/attachments/20100504/f90fb71d/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 581 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx-devel/attachments/20100504/f90fb71d/attachment-0001.gif>


More information about the nginx-devel mailing list