You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Allasso Travesser <al...@gmail.com> on 2013/12/13 15:56:19 UTC

[users@httpd] unable to set cookie in

Hello,

I am attempting to extend auth_digest_module for 2.2.  I am trying to set a cookie from a callback in the ap_hook_check_user_id hook, but the cookie does not get set.  I am using this code for setting the cookie:

static void setLowLevelInitCookie(request_rec *r)
{
    apr_table_set(r->headers_out, "Set-Cookie", "XXXXXXXXXXXX=1");
    ap_log_rerror(APLOG_MARK, APLOG_NOTICE, r, "Digest : XXXXX setting low-level init cookie");
}

I believe the code is getting run without throwing exception, because the code after it runs and updates the log.  Neither do I get any errors when compiling or restarting Apache.

I can run the same code for setting the cookie from ap_hook_handler in the same module and it works fine.

Are there only certain hooks from which you can set r->headers_out, or set cookies?

Thank you kindly,

Allasso



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] unable to set cookie in

Posted by Allasso Travesser <al...@gmail.com>.
that works, thank you very much.


On Dec 13, 2013, at 9:47 AM, Eric Covener <co...@gmail.com> wrote:

> maybe r->err_headers_out if it will not be a 200 response? (401?)
> 
> On Fri, Dec 13, 2013 at 9:56 AM, Allasso Travesser
> <al...@gmail.com> wrote:
>> Hello,
>> 
>> I am attempting to extend auth_digest_module for 2.2.  I am trying to set a cookie from a callback in the ap_hook_check_user_id hook, but the cookie does not get set.  I am using this code for setting the cookie:
>> 
>> static void setLowLevelInitCookie(request_rec *r)
>> {
>>    apr_table_set(r->headers_out, "Set-Cookie", "XXXXXXXXXXXX=1");
>>    ap_log_rerror(APLOG_MARK, APLOG_NOTICE, r, "Digest : XXXXX setting low-level init cookie");
>> }
>> 
>> I believe the code is getting run without throwing exception, because the code after it runs and updates the log.  Neither do I get any errors when compiling or restarting Apache.
>> 
>> I can run the same code for setting the cookie from ap_hook_handler in the same module and it works fine.
>> 
>> Are there only certain hooks from which you can set r->headers_out, or set cookies?
>> 
>> Thank you kindly,
>> 
>> Allasso
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>> 
> 
> 
> 
> -- 
> Eric Covener
> covener@gmail.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] unable to set cookie in

Posted by Eric Covener <co...@gmail.com>.
maybe r->err_headers_out if it will not be a 200 response? (401?)

On Fri, Dec 13, 2013 at 9:56 AM, Allasso Travesser
<al...@gmail.com> wrote:
> Hello,
>
> I am attempting to extend auth_digest_module for 2.2.  I am trying to set a cookie from a callback in the ap_hook_check_user_id hook, but the cookie does not get set.  I am using this code for setting the cookie:
>
> static void setLowLevelInitCookie(request_rec *r)
> {
>     apr_table_set(r->headers_out, "Set-Cookie", "XXXXXXXXXXXX=1");
>     ap_log_rerror(APLOG_MARK, APLOG_NOTICE, r, "Digest : XXXXX setting low-level init cookie");
> }
>
> I believe the code is getting run without throwing exception, because the code after it runs and updates the log.  Neither do I get any errors when compiling or restarting Apache.
>
> I can run the same code for setting the cookie from ap_hook_handler in the same module and it works fine.
>
> Are there only certain hooks from which you can set r->headers_out, or set cookies?
>
> Thank you kindly,
>
> Allasso
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>



-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org