As it looks removing the /r/n's solves the problem. 

Is the len=0 data really needed? It seem its OK just to return MG_TRUE in 
the event handler to send stuff out.

/Ake

On Wednesday, August 27, 2014 1:38:11 PM UTC+2, jshanab wrote:
>
> Wild guess, did you provide an end chunk? the one with 0 bytes so the 
> browser knows it is done.
>
>
> On Wed, Aug 27, 2014 at 7:14 AM, Åke Hedman <[email protected] 
> <javascript:>> wrote:
>
>> I try to set session variables in the MG_AUTH event and try to send
>>
>> sprintf( buf, "session=%s; max-age=3600; http-only\r\n", ret->m_sid );
>> mg_send_header( conn, "Set-Cookie", buf );
>> sprintf( buf, "user=%s\r\n", pUser );
>> mg_send_header( conn, "Set-Cookie", buf );
>>
>> strcpy( buf, "original_url=/; max-age=0\r\n" );
>> mg_send_header( conn, "Set-Cookie", buf );
>>
>> after a user has been validated (before MG_TRUE). But when I do this the 
>> code sent back from the server looks something like this
>>
>> *Set-Cookie: user=admin*
>>
>> *Set-Cookie: original_url=/; max-age=0*
>>
>> *Transfer-Encoding: chunked*
>>
>>  *1465*
>> *...html of page to show..."*
>>
>> and after that the browser wait forever for the page. If I remove the 
>> above code everything is fine. Looks like all of the page is treated as a 
>> header. I obviously do something wrong but can't understand what. Any 
>> pointers/hints are welcome.
>>
>> /Ake
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "mongoose-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/mongoose-users.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"mongoose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to