<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.newlc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>NewLC - Getting a cookie from HTTP response - Comments</title>
 <link>http://www.newlc.com/topic-1493</link>
 <description>Comments for &quot;Getting a cookie from HTTP response&quot;</description>
 <language>en</language>
<item>
 <title>Re: Getting a cookie from HTTP response</title>
 <link>http://www.newlc.com/topic-1493#comment-47162</link>
 <description>&lt;p&gt;hi Sasa,&lt;br /&gt;
Did you try to parse multi set-cookies from one HTTP header? I want to get the cookie value from one response header, but only the first set-cookie can be read out. Thanks.&lt;/p&gt;

&lt;p&gt;Landing&lt;/p&gt;</description>
 <pubDate>Tue, 24 Jun 2008 16:57:00 +0200</pubDate>
 <dc:creator>landingxue</dc:creator>
 <guid isPermaLink="false">comment 47162 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Getting a cookie from HTTP response</title>
 <link>http://www.newlc.com/topic-1493#comment-44645</link>
 <description>&lt;p&gt;Hi smitesh,&lt;/p&gt;

&lt;p&gt;I&#039;m glad you found it useful. I spent quite some time on that so I thought I will probably save some else&#039;s time by posting that code.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;br /&gt;
Sasa&lt;/p&gt;</description>
 <pubDate>Tue, 19 Feb 2008 13:40:09 +0100</pubDate>
 <dc:creator>sasa</dc:creator>
 <guid isPermaLink="false">comment 44645 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Getting a cookie from HTTP response</title>
 <link>http://www.newlc.com/topic-1493#comment-44642</link>
 <description>&lt;p&gt;Thnx dude &lt;br /&gt;
U make my day using this post &lt;br /&gt;
THis post is quite helpful to me &lt;br /&gt;
Regards&lt;br /&gt;
Smit &lt;/p&gt;</description>
 <pubDate>Tue, 19 Feb 2008 13:08:36 +0100</pubDate>
 <dc:creator>smitesh</dc:creator>
 <guid isPermaLink="false">comment 44642 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Getting a cookie from HTTP response</title>
 <link>http://www.newlc.com/topic-1493#comment-6565</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;&lt;div class=&quot;quoteheader&quot;&gt;Quote from: kelem&lt;/div&gt;&lt;div class=&quot;quote&quot;&gt;Thank you very much for answer.&lt;br /&gt;&lt;br /&gt;In the code used to read cookie variable Cookieval how is declared?&lt;br /&gt;thanks again&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Hi kelem,&lt;br /&gt;&lt;br /&gt;cookieValue was member variable in that class declared like this:&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;codeheader&quot;&gt;Code:&lt;/div&gt;&lt;div class=&quot;code&quot;&gt;#define KMaxHeaderValueLen&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;128&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;TBuf8&amp;lt;KMaxHeaderValueLen&amp;gt; cookieValue;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;If you find my answers helpful you can always thank me by clicking on &amp;quot;[Applaud]&amp;quot; link next to my answers &lt;img src=&quot;/sites/all/modules/smf_filter/smf_smileys/wink.gif&quot; alt=&quot;Wink&quot; border=&quot;0&quot; /&gt;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Sasa&lt;/div&gt;</description>
 <pubDate>Sun, 04 Mar 2007 16:49:30 +0100</pubDate>
 <dc:creator>sasa</dc:creator>
 <guid isPermaLink="false">comment 6565 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Getting a cookie from HTTP response</title>
 <link>http://www.newlc.com/topic-1493#comment-6564</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Thank you very much for answer.&lt;br /&gt;&lt;br /&gt;In the code used to read cookie variable Cookieval how is declared?&lt;br /&gt;thanks again&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description>
 <pubDate>Sat, 03 Mar 2007 20:38:44 +0100</pubDate>
 <dc:creator>kelem</dc:creator>
 <guid isPermaLink="false">comment 6564 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Getting a cookie from HTTP response</title>
 <link>http://www.newlc.com/topic-1493#comment-6563</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Hello kelem,&lt;br /&gt;&lt;br /&gt;I solved that and it worked fine for Symbian 7. I didn&amp;#039;t try that code on 3rd edition but I think it should work.&lt;br /&gt;&lt;br /&gt;Here is the code I used:&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;codeheader&quot;&gt;Code:&lt;/div&gt;&lt;div class=&quot;code&quot;&gt;void CNetwork::SetCookie(RHTTPHeaders aHeaders){&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;RStringF cookieField = iSess.StringPool().StringF(HTTP::ECookie,RHTTPSession::GetTable());&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;TBuf8&amp;lt;200&amp;gt; tempBuff;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;tempBuff.Append(_L8(&amp;quot;JSESSIONID=&amp;quot;));&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;int sLen = strlen(status.sessionId);&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;tempBuff.Append((const TUint8*)status.sessionId, sLen);&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;aHeaders.SetRawFieldL(cookieField, (const TDesC8&amp;amp;)tempBuff, _L8(&amp;quot;;&amp;quot;));&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;cookieField.Close();&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Where &amp;quot;status.sessionId&amp;quot; is char* holding the value that I needed to set as cookie&amp;#039;s value.&lt;br /&gt;&lt;br /&gt;I hope this will help you.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Sasa&lt;/div&gt;</description>
 <pubDate>Sat, 03 Mar 2007 18:38:17 +0100</pubDate>
 <dc:creator>sasa</dc:creator>
 <guid isPermaLink="false">comment 6563 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: Getting a cookie from HTTP response</title>
 <link>http://www.newlc.com/topic-1493#comment-6562</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;have you solved it?Work on 3rd edition?&lt;/div&gt;</description>
 <pubDate>Sat, 03 Mar 2007 13:25:52 +0100</pubDate>
 <dc:creator>kelem</dc:creator>
 <guid isPermaLink="false">comment 6562 at http://www.newlc.com</guid>
</item>
<item>
 <title>I succeded in reading but still can&#039;t write</title>
 <link>http://www.newlc.com/topic-1493#comment-6561</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;I posted a code for reading a cookie from http header but still can&#039;t write a cookie. I can write anything accept &amp;quot;Cookie&amp;quot;. When I write some value for &amp;quot;Cookie&amp;quot; field, after submiting the data, the &amp;quot;Cookie&amp;quot; field is clear.&lt;br /&gt;Please help me!&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;codeheader&quot;&gt;Code:&lt;/div&gt;&lt;div class=&quot;code&quot;&gt;RHTTPResponse resp = aTrans.Response&amp;#40;&amp;#41;;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;RStringPool strP = aTrans.Session&amp;#40;&amp;#41;.StringPool&amp;#40;&amp;#41;;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;RHTTPHeaders hdr = resp.GetHeaderCollection&amp;#40;&amp;#41;;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;THTTPHdrFieldIter it = hdr.Fields&amp;#40;&amp;#41;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;TBuf&amp;lt;KMaxHeaderNameLen&amp;gt; &amp;nbsp;fieldName16;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;TBuf&amp;lt;KMaxHeaderValueLen&amp;gt; fieldVal16;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;RStringF fieldCokie = strP.StringF&amp;#40;HTTP&amp;#58;&amp;#58;ESetCookie,RHTTPSession&amp;#58;&amp;#58;GetTable&amp;#40;&amp;#41;&amp;#41;;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;THTTPHdrVal fieldVal;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;THTTPHdrVal cookie;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if &amp;#40;hdr.GetField&amp;#40;fieldCokie,0,fieldVal&amp;#41; == KErrNone&amp;#41;&amp;#123;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;RStringF basic = strP.StringF&amp;#40;HTTP&amp;#58;&amp;#58;ECookie,RHTTPSession&amp;#58;&amp;#58;GetTable&amp;#40;&amp;#41;&amp;#41;;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;RStringF realm = strP.StringF&amp;#40;HTTP&amp;#58;&amp;#58;ECookieValue,RHTTPSession&amp;#58;&amp;#58;GetTable&amp;#40;&amp;#41;&amp;#41;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if &amp;#40;&amp;#40;fieldVal.StrF&amp;#40;&amp;#41; == basic&amp;#41; &amp;&amp; &lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;#40;!hdr.GetParam&amp;#40;fieldCokie, realm, cookie&amp;#41;&amp;#41;&amp;#41;&amp;#123;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;RStringF realmValStr = strP.StringF&amp;#40;cookie.StrF&amp;#40;&amp;#41;&amp;#41;;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;cookieValue.Copy&amp;#40;realmValStr.DesC&amp;#40;&amp;#41;&amp;#41;;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;#125;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&amp;#125;&lt;/div&gt;&lt;/div&gt;</description>
 <pubDate>Thu, 05 Feb 2004 17:51:54 +0100</pubDate>
 <dc:creator>sasa</dc:creator>
 <guid isPermaLink="false">comment 6561 at http://www.newlc.com</guid>
</item>
<item>
 <title>Getting a cookie from HTTP response</title>
 <link>http://www.newlc.com/topic-1493</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/topic-1493&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/topic-1493#comments</comments>
 <category domain="http://www.newlc.com/forums/communications">Communications</category>
 <pubDate>Wed, 04 Feb 2004 18:54:02 +0100</pubDate>
 <dc:creator>sasa</dc:creator>
 <guid isPermaLink="false">2529 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
