<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Windows Core Networking : Post Vista HTTP Client</title><link>http://blogs.msdn.com/wndp/archive/tags/Post+Vista+HTTP+Client/default.aspx</link><description>Tags: Post Vista HTTP Client</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>A Tale of 20 Cookies</title><link>http://blogs.msdn.com/wndp/archive/2006/08/28/a-tale-of-20-cookies.aspx</link><pubDate>Mon, 28 Aug 2006 15:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:703558</guid><dc:creator>wndpteam</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/wndp/comments/703558.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wndp/commentrss.aspx?PostID=703558</wfw:commentRss><description>&lt;P&gt;As more applications move to leveraging the web, either through desktop-integration or complete migration to a web model, maintaining user state on the web becomes critical. For many web sites and applications this means the use of in-memory and persistent cookies. 
&lt;P&gt;Netscape originally defined HTTP cookies in a &lt;A href="http://wp.netscape.com/newsref/std/cookie_spec.html"&gt;preliminary document&lt;/A&gt; and later the IETF standardized cookies in RFC’s &lt;A href="http://tools.ietf.org/html/rfc2109"&gt;2109&lt;/A&gt; and &lt;A href="http://tools.ietf.org/html/rfc2965"&gt;2965&lt;/A&gt;. Interestingly, the WinINet cookie implementation is still (mostly) modeled after the early Netscape document, which specifies that browsers should: 
&lt;UL&gt;
&lt;LI&gt;Maintain at least 300 cookies total, 
&lt;LI&gt;Support cookies up to 4KB in size each, 
&lt;LI&gt;Support no fewer than 20 cookies per unique host or domain&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;User-agents, such as mobile phones, have more relaxed recommendations. Internet Explorer 7.0 and WinINet support up to 20 cookies of 5KB each per domain with no set limits on the total number of cookies overall on a system. Even with these totals, some web applications may need more. 
&lt;P&gt;A follow-on question might be to ask what happens when a web application sends more than 20 cookies for a domain (21 cookies perhaps). The answer is that we maintain the 20 most recent cookies. &lt;I&gt;Recent&lt;/I&gt; is based on the order in which we received the cookies. That means if your web server sends 21 cookies named Cookie1, Cookie2 thru Cookie21 to WinINet (via Internet Explorer or otherwise), your web server would only receive Cookie2, Cookie3 thru Cookie21 on the next request from WinINet.&amp;nbsp; We simply maintain the 20 most recent and quietly discard the other cookies for that host/domain. 
&lt;P&gt;Next, what happens when a web application exceeds the other maximum and sends a cookie with a size over 5120 bytes (&amp;gt;5KB)?&amp;nbsp; Instead of truncating the values of oversized cookies, we simply discard these cookies. We chose to discard instead of truncate in order to avoid any type of cookie data corruption.&amp;nbsp; I think you would agree that a cookie with a value of $10000 is very different from a truncated one with a value of $100. In addition, it is easier for the server application to check for the existence of a cookie and react if it is missing versus detecting if the value is correct. 
&lt;P&gt;There are ways to work-around&amp;nbsp;our current&amp;nbsp;20x cookie limit.&amp;nbsp;&amp;nbsp;In my opinion, the&amp;nbsp;best work-around is to leverage a durable back-end store for user information and use cookies for user tracking&amp;nbsp;and lightweight values.&amp;nbsp; This keeps the request/response more streamlined. 
&lt;P&gt;Another work-around, in cases where you absolutely need&amp;nbsp;more&amp;nbsp;data sent back-and-forth within the 20-cookie limit, is to pack more data into fewer cookies. This means that instead of: 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Set-Cookie: FirstName=Billy 
&lt;P&gt;Set-Cookie: LastName=Anders&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can combine into something&amp;nbsp;like: 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Set-Cookie: FullName=Billy~Anders&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then, in your web application, you split&amp;nbsp;the &lt;I&gt;FullName&lt;/I&gt; cookie.&amp;nbsp; Here is a rough (&lt;I&gt;rough&lt;/I&gt; meaning no error handling)&amp;nbsp;ASP.NET&amp;nbsp;example in C#: 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;string[] Names = Request.Cookies[“FullName”].Split(‘~’); 
&lt;P&gt;if (Names.Length == 2) { 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;string FirstName = Names[0]; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;string LastName = Names[1]; 
&lt;P&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Admittedly, this is not as straight-forward as the&amp;nbsp;standard ASP.NET approach of: 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;string FirstName = Request.Cookies["FirstName"]; 
&lt;P&gt;string LastName = Request.Cookies["LastName"];&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;However, this may prove helpful if you ever need to get around&amp;nbsp;the 20x limit that we currently have.&amp;nbsp; 
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;&lt;EM&gt;Update: The sample above is to demonstrate the concept of packing more data into fewer cookies for any web development platform. ASP.NET natively supports&amp;nbsp;subkeys which already allow you to&amp;nbsp;store multiple values within cookies.&amp;nbsp;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;&lt;EM&gt;s&lt;/EM&gt;&lt;/FONT&gt;&lt;FONT color=#000000&gt;&lt;FONT color=#000000&gt;&lt;EM&gt;tring FirstName = Request.Cookies["Name"]["First"];&lt;BR&gt;string LastName&amp;nbsp; = Request.Cookies["Name"]["Last"];&lt;/EM&gt;&lt;/FONT&gt; &lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The current limits seem reasonable,&amp;nbsp;but we would like to hear from you on whether that is case or not. Are you writing web applications that would like to use the browser’s cookie store beyond the 20x and 5KB limits that we have? Do you need 25, 50, 100,&amp;nbsp;250&amp;nbsp;cookies for your application? 
&lt;P&gt;
&lt;P&gt;-&amp;nbsp;Billy Anders&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=703558" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/wndp/archive/tags/WinINet/default.aspx">WinINet</category><category domain="http://blogs.msdn.com/wndp/archive/tags/Post+Vista+HTTP+Client/default.aspx">Post Vista HTTP Client</category></item><item><title>Content-Encoding != Content-Type</title><link>http://blogs.msdn.com/wndp/archive/2006/08/21/Content-Encoding-not-equal-Content-Type.aspx</link><pubDate>Mon, 21 Aug 2006 18:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:699741</guid><dc:creator>wndpteam</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/wndp/comments/699741.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wndp/commentrss.aspx?PostID=699741</wfw:commentRss><description>&lt;P&gt;&lt;A href="http://www.ietf.org/rfc/rfc2616.txt"&gt;RFC 2616&lt;/A&gt; for HTTP 1.1 specifies how web servers must indicate encoding transformations using the &lt;EM&gt;Content-Encoding&lt;/EM&gt; header. Although on the surface, &lt;EM&gt;Content-Encoding&lt;/EM&gt; (e.g., gzip, deflate, compress) and &lt;EM&gt;Content-Type&lt;/EM&gt; (e.g., x-application/x-gzip) sound similar, they are, in fact, two distinct pieces of information. Whereas servers use &lt;EM&gt;Content-Type&lt;/EM&gt; to specify the data type of the entity body, which can be useful for client applications that want to open the content with the appropriate application, &lt;EM&gt;Content-Encoding&lt;/EM&gt; is used solely to specify any additional encoding done by the server before the content was transmitted to the client. Although the HTTP RFC outlines these rules pretty clearly, some web sites respond with "gzip" as the Content-Encoding even though the server has not gzipped the content. &lt;/P&gt;
&lt;P&gt;Our testing has shown this problem to be limited to some sites that serve Unix/Linux style "tarball" files. Tarballs are gzip compressed archives files. By setting the Content-Encoding header to "gzip" on a tarball, the server is specifying that it has additionally gzipped the gzipped file. This, of course, is unlikely but not impossible or non-compliant. &lt;/P&gt;
&lt;P&gt;Therein lies the problem. A server responding with content-encoding, such as "gzip," is specifying the necessary mechanism that the client needs in order to decompress the content. If the server did not actually encode the content as specified, then the client's decompression would fail. &lt;/P&gt;
&lt;P&gt;Here is a potentially over-simplified example: &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Windows Vista Networking Rocks! 
&lt;LI&gt;Jvaqbjf Ivfgn Argjbexvat Ebpxf! &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;If I mistakenly claim that string a) has been encoded using the simple &lt;A href="http://en.wikipedia.org/wiki/ROT13"&gt;ROT-13&lt;/A&gt; obfuscation scheme when in actuality it has not, then the decoded message b) will be very different than the intended message. &lt;/P&gt;
&lt;P&gt;Since the &lt;A href="http://en.wikipedia.org/wiki/Artificial_intelligence"&gt;AI&lt;/A&gt; engine for WinINet isn't yet ready for production (joke), we try and work-around these non-compliant server responses but that isn't the right long-term approach. The fix and the ask, is for web server, extension and application authors to test their servers to see if they exhibit this behavior and if so fix their implementations before we remove our client-side &lt;EM&gt;hacks&lt;/EM&gt;. &lt;/P&gt;
&lt;P&gt;To test your server for compliance, issue a simple HTTP 1.1 request, including the "Accept-Encoding: gzip" for a .gz file and inspect the headers. If you see Content-Encoding: x-gzip or gzip, then the server is either gzip-encoding the already gzipped file or it is misstating that the content has been encoded by the server before transmission and therefore perpetuating client HTTP stacks, such as WinINet, having to absorb and hide this bad server behavior. &lt;/P&gt;
&lt;P&gt;-Billy Anders&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=699741" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/wndp/archive/tags/WinINet/default.aspx">WinINet</category><category domain="http://blogs.msdn.com/wndp/archive/tags/WinHttp/default.aspx">WinHttp</category><category domain="http://blogs.msdn.com/wndp/archive/tags/Http.sys/default.aspx">Http.sys</category><category domain="http://blogs.msdn.com/wndp/archive/tags/Post+Vista+HTTP+Client/default.aspx">Post Vista HTTP Client</category></item><item><title>Wanted: Developer feedback for our "Next Generation" client HTTP stack</title><link>http://blogs.msdn.com/wndp/archive/2006/06/06/619376.aspx</link><pubDate>Tue, 06 Jun 2006 22:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:619376</guid><dc:creator>wndpteam</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/wndp/comments/619376.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wndp/commentrss.aspx?PostID=619376</wfw:commentRss><description>As we&amp;nbsp;begin the&amp;nbsp;planning phase for our &lt;A HREF="/wndp/archive/2006/03/23/559468.aspx"&gt;"Next Generation" client&amp;nbsp;HTTP stack&lt;/A&gt;, we would love to hear from developers using our existing APIs (WinINet and WinHTTP). Please help us understand what your experience has been so far and what you would like to see in any future releases by filling out &lt;A href="https://connect.microsoft.com/WNDP/Survey/Survey.aspx?SurveyID=1188"&gt;this survey&lt;/FONT&gt;&lt;/A&gt;. 
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;-Jonathan Silvera&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=619376" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/wndp/archive/tags/WinINet/default.aspx">WinINet</category><category domain="http://blogs.msdn.com/wndp/archive/tags/WinHttp/default.aspx">WinHttp</category><category domain="http://blogs.msdn.com/wndp/archive/tags/Post+Vista+HTTP+Client/default.aspx">Post Vista HTTP Client</category></item><item><title>What's next on the client HTTP stack front</title><link>http://blogs.msdn.com/wndp/archive/2006/03/23/559468.aspx</link><pubDate>Fri, 24 Mar 2006 03:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:559468</guid><dc:creator>wndpteam</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/wndp/comments/559468.aspx</comments><wfw:commentRss>http://blogs.msdn.com/wndp/commentrss.aspx?PostID=559468</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="http://www.microsoft-watch.com/article2/0,2180,1940567,00.asp"&gt;http://www.microsoft-watch.com/article2/0,2180,1940567,00.asp&lt;/A&gt;&lt;BR&gt;Hachamovitch acknowledged Microsoft already is building the next two versions of IE. He declined to offer guidelines on delivery schedules or feature sets, other than to say one of the two versions will include "&lt;STRONG&gt;a complete reworking of the networking stack&lt;/STRONG&gt;." &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That would be us. We are going to be busy for awhile :)&lt;/P&gt;
&lt;P&gt;-- Ari Pernick&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=559468" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/wndp/archive/tags/WinINet/default.aspx">WinINet</category><category domain="http://blogs.msdn.com/wndp/archive/tags/WinHttp/default.aspx">WinHttp</category><category domain="http://blogs.msdn.com/wndp/archive/tags/Post+Vista+HTTP+Client/default.aspx">Post Vista HTTP Client</category></item></channel></rss>