title: Sharing authentication cookie among Asp.Net Core 1 (MVC6) and MVC 5 applications
body: <p>I have a few MVC 5 applications that share the same authentication cookie. I'm using ASP.NET Identity to create the cookie.</p>
  
  <p>I checking if the user is authenticated using Owin's helper method, like so:</p>
  
  <pre><code>app.UseCookieAuthentication(
      new CookieAuthenticationOptions
      {
          AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
          ExpireTimeSpan = TimeSpan.FromMinutes(expirationTimeInMinutes),
          LoginPath = new PathString("/Account/Login"),
          Provider = new CookieAuthenticationProvider()
      });
  </code></pre>
  
  <p>And in all applications using this cookie, I have the following config in the web.config file:</p>
  
  <pre><code>&lt;machineKey validationKey="..." decryptionKey="..." validation="SHA1" /&gt;
  </code></pre>
  
  <p>As I understand, this configuration allows the applications to decrypt the same cookie.</p>
  
  <p>In the MVC6 application I'm setting it up to use the cookies like this:</p>
  
  <pre><code>app.UseCookieAuthentication(options =&gt;
    {
      //options.AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie;
      options.ExpireTimeSpan = TimeSpan.FromMinutes(20);
      options.LoginPath = new PathString("/Account/login");
      //options.Provider = new CookieAuthenticationProvider()
    });
  </code></pre>
  
  <p>OK, here's my problem the configuration is already different, as I don't know to specify the provider nor the authentication type.</p>
  
  <p>After, I'd have to config the decryption key, but as I understand MVC 6 doesn't have a web.config file. So how can I achieved this?</p>