<?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>Karthic's blog on IIS, ASP.NET &amp; BizTalk</title><link>http://blogs.msdn.com/karthics/default.aspx</link><description /><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Introduction to Biztalk</title><link>http://blogs.msdn.com/karthics/archive/2007/08/10/introduction-to-biztalk.aspx</link><pubDate>Fri, 10 Aug 2007 06:39:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4317387</guid><dc:creator>karthics</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/karthics/comments/4317387.aspx</comments><wfw:commentRss>http://blogs.msdn.com/karthics/commentrss.aspx?PostID=4317387</wfw:commentRss><description>&lt;p&gt;&lt;font face="v" size="2"&gt;BizTalk is an Enterprise Application Integration (EAI) tool. It can be used to integrate applications running within an organization or outside the organization. Typical example for the first scenario would be integrating a SAP application with a purchase order application. A B2B application is a good example for the second scenario where applications from different organizations are integrated.&lt;/font&gt; &lt;p&gt;&lt;font face="v" size="2"&gt;BizTalk works based on the content-based publish/subscribe architecture. Within BizTalk, the communication is using xml.&lt;/font&gt; &lt;p&gt;&lt;b&gt;&lt;font face="Verdana" size="2"&gt;How it works at a high level&lt;/font&gt;&lt;/b&gt; &lt;p&gt;&lt;font face="Verdana" size="2"&gt;BizTalk receives the data using the receive port/adapter and uses one of protocols - file, http, soap etc to communicate with the external application. Once the data is received by the adapter, it passes through the receive pipeline (series of components), gets converted into xml messages and is stored in the SQL Server database. If there any business processes or business rules that needs to be performed, it is done in orchestration as shown below. Once the orchestration is done, the message is written back to the database; from here it is picked up by the send pipeline/adapters depending on the subscriptions. The send adapter converts the xml message into a format which is understood by the target application.&lt;/font&gt; &lt;p&gt;&lt;img height="362" src="http://blogs.msdn.com/blogfiles/karthics/WindowsLiveWriter/IntroductiontoBiztalk_C00C/clip_image002.gif" width="557"&gt; &lt;p&gt;Will post more articles as I progress with Biztalk.  &lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4317387" width="1" height="1"&gt;</description></item><item><title>Learning Biztalk</title><link>http://blogs.msdn.com/karthics/archive/2007/07/31/learning-biztalk.aspx</link><pubDate>Tue, 31 Jul 2007 02:54:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4138744</guid><dc:creator>karthics</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/karthics/comments/4138744.aspx</comments><wfw:commentRss>http://blogs.msdn.com/karthics/commentrss.aspx?PostID=4138744</wfw:commentRss><description>&lt;p&gt;&lt;font face="verda" size="2"&gt;I'm getting my hands dirty with Biztalk.&amp;nbsp; Very soon you will see some articles on Biztalk here :-)&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4138744" width="1" height="1"&gt;</description></item><item><title>How to enable http compression for a folder in IIS 6.0</title><link>http://blogs.msdn.com/karthics/archive/2007/06/08/how-to-enable-http-compression-for-a-folder-in-iis-6-0.aspx</link><pubDate>Fri, 08 Jun 2007 08:54:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3155698</guid><dc:creator>karthics</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/karthics/comments/3155698.aspx</comments><wfw:commentRss>http://blogs.msdn.com/karthics/commentrss.aspx?PostID=3155698</wfw:commentRss><description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="ver" size="2"&gt;By default, when you try to enable compression for a folder in IIS 6.0, you will get the following error message &lt;/font&gt; &lt;p&gt;&lt;font face="ver" size="2"&gt;G:\Inetpub\AdminScripts&amp;gt;cscript adsutil.vbs set w3svc/1/root/sample/DoDynamicCompression true&lt;br&gt;Microsoft (R) Windows Script Host Version 5.6&lt;br&gt;Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. &lt;/font&gt; &lt;p&gt;&lt;font face="ver" size="2"&gt;The path requested could not be found.&lt;br&gt;ErrNumber: -2147024893 (0x80070003)&lt;br&gt;Error Trying To Get the Object: w3svc/1/root/sample &lt;/font&gt; &lt;p&gt;&lt;font face="ver" size="2"&gt;In order to make it work, you will have to create a key for the folder in the IIS metabase &lt;/font&gt; &lt;p&gt;&lt;font face="ver" size="2"&gt;To create a key, go to the properties of the folder and enable and disable the log visits check box or if its already enabled, disable and enable it again and click on apply and ok. This will create the following key in the metabase. &lt;/font&gt; &lt;p&gt;&lt;font face="verda" size="2"&gt;&amp;lt;IIsWebDirectory Location ="/LM/W3SVC/1/ROOT/sample"&amp;gt;&lt;br&gt;&amp;lt;Custom Name="UNCPassword" ID="3003" Value="49634462500000000600000040000000b948cacfe79500009c1b6d08e34531889ceb6984a2feb9d7d3c8ade09b7ff295b59459ff6d47380aca6382e06e7957c3335a4dd5604625dec0b5d7a350161fa8c9b55089ae494e7a"&lt;br&gt;Type="STRING"&lt;br&gt;UserType="IIS_MD_UT_FILE"&lt;br&gt;Attributes="INHERIT | SECURE"&lt;br&gt;/&amp;gt;&lt;/font&gt;  &lt;p&gt;&lt;font face="ver" size="2"&gt;&lt;/font&gt; &lt;p&gt;&lt;font face="ver" size="2"&gt;Once the above key is created for the folder in the metabase, you should be able to enable compression at the folder level by running the following commands from the inetpub\adminscripts folder&lt;/font&gt;  &lt;p&gt;&lt;font face="ver" size="2"&gt;1) cscript adsutil.vbs set w3svc/&amp;lt;WebSiteIdentifier&amp;gt;/Root/&amp;lt;FolderName&amp;gt;/DoDynamicCompression true for enabling dynamic compression&lt;br&gt;2) cscript adsutil.vbs set w3svc/&amp;lt;WebSiteIdentifier&amp;gt;/Root/&amp;lt;FolderName&amp;gt;/DoStaticCompression true for enabling static compression&lt;/font&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3155698" width="1" height="1"&gt;</description></item><item><title>How a session id is generated for an aspx page in .net framework 1.1</title><link>http://blogs.msdn.com/karthics/archive/2007/05/31/how-a-session-id-is-created-for-an-aspx-page.aspx</link><pubDate>Thu, 31 May 2007 09:43:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3002862</guid><dc:creator>karthics</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/karthics/comments/3002862.aspx</comments><wfw:commentRss>http://blogs.msdn.com/karthics/commentrss.aspx?PostID=3002862</wfw:commentRss><description>&lt;p&gt;&lt;font size="2"&gt;In this blog, I just wanted to write about the method within the .net framework which is responsible for generating the session id when a client requests an aspx page for the first time. This article doesn’t talk about the various scenarios under which the session id is created.&lt;/font&gt;  &lt;p&gt;&lt;font size="2"&gt;I was curious to know which class/method within the .net framework is used to generate the session id when a request for an aspx page comes in. I was looking at the SessionStateModule class under the System.Web.SessionState namespace using the .net reflector written by Lutz Roeder - &lt;/font&gt;&lt;a href="http://www.aisto.com/roeder/dotnet/"&gt;&lt;font color="#0000ff" size="2"&gt;http://www.aisto.com/roeder/dotnet/&lt;/font&gt;&lt;/a&gt;  &lt;p&gt;&lt;font size="2"&gt;Inside this class, there is a method with the following signature&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;private IAsyncResult BeginAcquireState(object source, EventArgs e, AsyncCallback cb, object extraData)&lt;br&gt;{ &lt;/font&gt; &lt;p&gt;&lt;font color="#800040" size="2"&gt;}&lt;/font&gt;  &lt;p&gt;&lt;font size="2"&gt;Within this method, there is an if else statement which checks if the private string rqId is null or not. This is the string which actually stores the session id. &lt;/font&gt; &lt;p&gt;&lt;font color="#800040" size="2"&gt;if (this._rqId != null)&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;{&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sessionStateItem = this.GetSessionStateItem();&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;}&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;else&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;{&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this._rqId = &lt;strong&gt;SessionId.Create&lt;/strong&gt;(ref this._randgen);&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!s_config._isCookieless)&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;HttpCookie cookie = &lt;b&gt;CreateSessionCookie&lt;/b&gt;(this._rqId);&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!this._rqContext.Response.IsBuffered())&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new HttpException(HttpRuntime.FormatResourceString("Cant_write_session_id_in_cookie_because_response_was_flushed"));&lt;/font&gt;  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;font color="#800040"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;this._rqContext.Response.Cookies.Add(cookie);&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this._rqAddedCookie = true;&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this._rqContext.Response.SetAppPathModifier(AppPathModifierFromSessionId(this._rqId));&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HttpRequest request = this._rqContext.Request;&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string url = request.Path;&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string queryStringText = request.QueryStringText;&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((queryStringText != null) &amp;amp;&amp;amp; (queryStringText.Length &amp;gt; 0))&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url = url + "?" + queryStringText;&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this._rqContext.Response.Redirect(url, false);&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this._rqAr.Complete(true, null, null);&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IAsyncResult result = this._rqAr;&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; application.CompleteRequest();&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return result;&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;}&lt;/font&gt;  &lt;p&gt;&lt;font size="2"&gt;In the above code snippet, if the rqId string is null, then the Session.Create method is called. &lt;/font&gt; &lt;p&gt;&lt;font size="2"&gt;Session is an internal class within the System.Web.SessionState namespace which has a static method Create with the following definition&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;internal static string Create(ref RandomNumberGenerator randgen)&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;{&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (randgen == null)&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; randgen = new RNGCryptoServiceProvider();&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; byte[] data = new byte[15];&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; randgen.GetBytes(data);&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Encode(data);&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;}&lt;/font&gt;  &lt;p&gt;&lt;font size="2"&gt;Once the session id is generated, depending on how the cookieless attribute is set in the web.config (set to true or false) file; the session id is either added to the cookies collection or added to the URL.&amp;nbsp; &lt;/font&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Scenario 1 : Cookieless attribute set to false&lt;/strong&gt;&lt;/font&gt;  &lt;p&gt;&lt;font size="2"&gt;If the cookieless attribute is set to false, then the session id is added to the cookies collection by making a call to the CreateSessionCookie method &lt;/font&gt; &lt;p&gt;&lt;font color="#800040" size="2"&gt;private static HttpCookie CreateSessionCookie(string id)&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;{&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; HttpCookie cookie = new HttpCookie("&lt;b&gt;ASP.NET_SessionId&lt;/b&gt;", id);&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cookie.Path = "/";&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return cookie;&lt;/font&gt;  &lt;p&gt;&lt;font color="#800040" size="2"&gt;}&lt;/font&gt;  &lt;p&gt;&lt;font size="2"&gt;After the cookie is created, it is added to the Response.Cookies collection.&amp;nbsp; I was able to check the request and response headers using the fiddler tool (&lt;/font&gt;&lt;a href="http://www.fiddlertool.com"&gt;&lt;font color="#0000ff" size="2"&gt;www.fiddlertool.com&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;).&lt;/font&gt;&amp;nbsp;  &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;HTTP Request Header :&lt;/font&gt;&lt;/strong&gt;  &lt;p&gt;&lt;font size="2"&gt;GET /webapplication1/webform1.aspx HTTP/1.1&lt;br&gt;Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*&lt;br&gt;Accept-Language: en-us&lt;br&gt;UA-CPU: x86&lt;br&gt;Accept-Encoding: gzip, deflate&lt;br&gt;User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; InfoPath.2; .NET CLR 2.0.50727)&lt;br&gt;Host: win2k3-6114&lt;br&gt;Proxy-Connection: Keep-Alive &lt;/font&gt; &lt;p&gt;&lt;strong&gt;HTTP Response Header : &lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;HTTP/1.1 200 OK&lt;br&gt;Date: Tue, 29 May 2007 07:44:27 GMT&lt;br&gt;Server: Microsoft-IIS/6.0&lt;br&gt;MicrosoftOfficeWebServer: 5.0_Pub&lt;br&gt;X-Powered-By: ASP.NET&lt;br&gt;X-AspNet-Version: 1.1.4322&lt;br&gt;Set-Cookie: &lt;strong&gt;ASP.NET_SessionId&lt;/strong&gt;=iddajxme35irfr45tcynode1; path=/&lt;br&gt;Cache-Control: private&lt;br&gt;Content-Type: text/html; charset=utf-8&lt;br&gt;Content-Length: 662&lt;/font&gt;  &lt;p&gt;&lt;font size="2"&gt;Notice the name of the cookie in the response header.&amp;nbsp; You will also see this in the IIS log, once you enable the Cookie field for the specific web site and access the aspx page.&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;IIS Log: &lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;#Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) &lt;b&gt;cs(Cookie)&lt;/b&gt; sc-status sc-substatus sc-win32-status&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;2007-05-28 05:04:03 W3SVC1 65.52.76.126 GET /webapplication1/webform1.aspx - 80 - 65.52.76.126 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.2;+.NET+CLR+1.1.4322;+InfoPath.2;+.NET+CLR+2.0.50727) &lt;b&gt;ASP.NET_SessionId&lt;/b&gt;=&lt;b&gt; &lt;/b&gt;iddajxme35irfr45tcynode1 200 0 0&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Scenario&amp;nbsp;2 - Cookieless attribute set to true&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;If the cookieless attribute is set to true, then the session id is added to the url.&amp;nbsp; In this case, two&amp;nbsp;trips are made to the server.&amp;nbsp; First time, when the page is requested, the server responds with status code 302 (object moved) and in the next request, the server responds with status code 200 (OK. The client request has succeeded).&amp;nbsp; This is because once the session id is added to the url, the Response.Redirect method is called. Notice the request and the response headers below.&amp;nbsp; &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;HTTP Request Header :&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;GET /webapplication1/webform1.aspx HTTP/1.1&lt;br&gt;Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */* &lt;br&gt;Accept-Language: en-us&lt;br&gt;UA-CPU: x86&lt;br&gt;Accept-Encoding: gzip, deflate&lt;br&gt;User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; InfoPath.2; .NET CLR 2.0.50727)&lt;br&gt;Host: win2k3-6114&lt;br&gt;Proxy-Connection: Keep-Alive&lt;/font&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;HTTP Response Header : &lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;HTTP/1.1 302 Found&lt;br&gt;Date: Tue, 29 May 2007 08:06:19 GMT &lt;br&gt;Server: Microsoft-IIS/6.0 &lt;br&gt;MicrosoftOfficeWebServer: 5.0_Pub &lt;br&gt;X-Powered-By: ASP.NET &lt;br&gt;X-AspNet-Version: 1.1.4322&lt;br&gt;Location: /webapplication1/(n2xrh3452rylcuevsv103cep)/webform1.aspx &lt;br&gt;Cache-Control: private &lt;br&gt;Content-Type: text/html; charset=utf-8 &lt;br&gt;Content-Length: 662 &lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;HTTP Request Header :&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;GET /webapplication1/(n2xrh3452rylcuevsv103cep)/webform1.aspx HTTP/1.1&lt;br&gt;Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */* &lt;br&gt;Accept-Language: en-us&lt;br&gt;UA-CPU: x86&lt;br&gt;Accept-Encoding: gzip, deflate&lt;br&gt;User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; InfoPath.2; .NET CLR 2.0.50727)&lt;br&gt;Host: win2k3-6114&lt;br&gt;Proxy-Connection: Keep-Alive&lt;/font&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;HTTP Response Header : &lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;HTTP/1.1 200 OK &lt;br&gt;Date: Tue, 29 May 2007 08:06:19 GMT &lt;br&gt;Server: Microsoft-IIS/6.0 &lt;br&gt;MicrosoftOfficeWebServer: 5.0_Pub &lt;br&gt;X-Powered-By: ASP.NET &lt;br&gt;X-AspNet-Version: 1.1.4322 &lt;br&gt;Cache-Control: private &lt;br&gt;Content-Type: text/html; charset=utf-8 &lt;br&gt;Content-Length: 662&lt;/font&gt;  &lt;p&gt;&lt;font size="2"&gt;You will not see the cookie being set in the response headers.&amp;nbsp;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;If you check the URL, it will look something like this &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://&amp;lt;ServerName&amp;gt;/webapplication1/(n2xrh3452rylcuevsv103cep)/webform1.aspx"&gt;&lt;font color="#0000ff" size="2"&gt;http://&amp;lt;ServerName&amp;gt;/webapplication1/(n2xrh3452rylcuevsv103cep)/webform1.aspx&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;In the IIS log, you will see two entries for webform1.aspx page, one with status code 302 and the next one with status code 200. However, the cookie value will be empty.&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;IIS Log:&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;#Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) &lt;b&gt;cs(Cookie)&lt;/b&gt; sc-status sc-substatus sc-win32-status &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;2007-05-29 08:06:19 W3SVC1 65.52.76.126 GET /webapplication1/webform1.aspx - 80 - 65.52.76.126 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.2;+.NET+CLR+1.1.4322;+InfoPath.2;+.NET+CLR+2.0.50727) - 302 0 0 &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;2007-05-29 08:06:19 W3SVC1 65.52.76.126 GET /webapplication1/webform1.aspx - 80 - 65.52.76.126 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.2;+.NET+CLR+1.1.4322;+InfoPath.2;+.NET+CLR+2.0.50727) &lt;b&gt;-&lt;/b&gt; 200 0 0&amp;nbsp;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;I hope you enjoyed reading this article.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3002862" width="1" height="1"&gt;</description></item></channel></rss>