title: Issues with cross-subdomain authentication with WebForms 3.5 and MVC 4.0
body: <p>I have two web applications that implements a asp.net membership provider. 
  It is a slightly modified membership provider (so it's a custom membership provider) but I think that that is irrelevant for this post. </p>
  
  <p>The application run in the same domain and I want to have cross authentication between them using cookies.(they run in app1.mydomain.com / app2.mydomain.com)</p>
  
  <p>I'm using two applications implementing the same provider: </p>
  
  <ul>
  <li>WebForms 3.5</li>
  <li>MVC 4.5</li>
  </ul>
  
  <p>In both applications I have the same sections configured in the webconfig: authentication, forms, machineKey, membership, roleManager.
  They both use a custom Membership and role provider, which is the same for both apps.
  They all reside inside the same domain. 
  Authentication in each application works well.</p>
  
  <p>Problem:</p>
  
  <ul>
  <li>In the 4.5 app, if you log in, and then go to the 3.5 app and you don’t get logged in</li>
  <li>If you log into the 3.5 app, you are not logged into the 4.5 app</li>
  <li>If you log into the 4.0 app, you are LOGGED out of the 3.5 app even if you were logged in before, and the same on the other way</li>
  </ul>
  
  <p>Tests I’ve done:</p>
  
  <ul>
  <li>I’ve set up a default MVC 4.0/4.5 site and a default Web Forms 4.0/4.5 site, and the cross domain cookies works perfect.</li>
  <li>But when a set up a default MVC 4.0/4.5 site and a default Web Forms 3.5 site, the SSO doesn’t work.</li>
  </ul>
  
  <p>It seems to be a framework incompatibility, or something has change between frameworks when it comes to creating or encrypting the cookie, seems the browser doesn’t send the cookie created by one site to the other.
  On the other hand it works great for MVC and WebForms with 4.0/4.5.</p>
  
  <p>These are the web.config sections of each of the applications: </p>
  
  <p>MVC 4:</p>
  
  <pre><code>&lt;authentication mode="Forms"&gt;
    &lt;forms name="isep" loginUrl="~/Account/LogIn" timeout="20" protection="All" /&gt;
  &lt;/authentication&gt;
  
  &lt;machineKey compatibilityMode="Framework20SP2" validationKey="85A2E75F1FFEEAC971928062F844F0AFAE876B422503FCF7F80C1B84683C323049ACCC02A47D54E2E98B0422D2E3EFF1B16B7E85E8359EF6ABC52974D0EB9AA7" decryptionKey="FCD4A55D93A720914FA40EEC9599BD81BECE1490EB232DB8DD649BBB0D565194" validation="SHA1" decryption="Auto" /&gt;
  </code></pre>
  
  <p>WebForms 3.5:</p>
  
  <pre><code>&lt;authentication mode="Forms"&gt;
    &lt;forms name="isep" loginUrl="login2.aspx" timeout="20" protection="All" /&gt;
  &lt;/authentication&gt;
  
  &lt;machineKey validationKey="85A2E75F1FFEEAC971928062F844F0AFAE876B422503FCF7F80C1B84683C323049ACCC02A47D54E2E98B0422D2E3EFF1B16B7E85E8359EF6ABC52974D0EB9AA7" decryptionKey="FCD4A55D93A720914FA40EEC9599BD81BECE1490EB232DB8DD649BBB0D565194" validation="SHA1" decryption="Auto" /&gt;
  
  &lt;authorization&gt;
    &lt;deny users="?"/&gt;
  &lt;/authorization&gt;
  </code></pre>
  
  <p>Any clue about this?</p>
  
  <p>Thanks!.. </p>
  
  <p>PnP</p>