Welcome! Log In Create A New Profile

Advanced

Re: A problem with modifing r->headers_in.cookies

Srebrenko Šehić
May 04, 2010 02:30AM
On Tue, May 4, 2010 at 6:35 AM, Charles Tien <spirittf@gmail.com> wrote:
>
> No one can help me? :(
>
> On Sun, May 2, 2010 at 11:37 AM, tianfeng <spirittf@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!!

Can you try registering your handler at NGX_HTTP_REWRITE_PHASE?
Perhaps PREACCESS_PHASE is too early in hooks processing.

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

A problem with modifing r->headers_in.cookies Attachments

tianfeng 3209 May 01, 2010 11:38PM

Re: A problem with modifing r->headers_in.cookies Attachments

Charles Tien 1121 May 04, 2010 12:36AM

Re: A problem with modifing r->headers_in.cookies

Srebrenko Šehić 1018 May 04, 2010 02:30AM

Re: A problem with modifing r->headers_in.cookies

Charles Tien 1794 May 05, 2010 02:14AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 243
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready