Access Cookie into sub domains
<p>I want to host multiple sites under one domain. But currently I am working on localhost, so I added these 2 lines to my etc/hosts file:</p>

<pre><code>127.0.0.1 something.com
127.0.0.1 orders.something.com
</code></pre>

<p>There are 2 applications hosted in IIS. One can be browsed using: <code>orders.something.com/OrdersSSO</code> and other can be browsed using <code>something.com/SSOSample/</code>.</p>

<p>I created authentication cookie using this code in <code>something.com/SSOSample/</code>:</p>

<pre><code>FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
                                                                "abc",
                                                                DateTime.Now,
                                                                DateTime.Now.AddMinutes(30), // value of time out property
                                                                true, // Value of IsPersistent property
                                                                String.Empty,
                                                                FormsAuthentication.FormsCookiePath);

                            string encryptedTicket = FormsAuthentication.Encrypt(ticket);
                            HttpCookie authCookie = new HttpCookie(
                        FormsAuthentication.FormsCookieName,
                        encryptedTicket);

                            Response.Cookies.Add(authCookie);
</code></pre>

<p>So I am logged in this application. However when I browse orders.something.com/OrdersSSO I don't get my authentication cookie.</p>

<p>This is my forms section in web.config:</p>

<pre><code>&lt;authentication mode="Forms"&gt;
      &lt;forms loginUrl="~/Account/Login.aspx" enableCrossAppRedirects="true" timeout="2880" domain=".something.com" /&gt;
    &lt;/authentication&gt;
</code></pre>

<p>What am I missing?</p>
