title: How to Response.Cookies.Append() in ASP.Net Core 1.1?
body: <p>I am trying to add Globalization to an Intranet application, using a cookie to allow users a culture preference. The middleware is set up and running but I have run into an issue with appending to the cookie based on the UI selection.</p>
  
  <p>The method is straight from the Asp.Net Core documentation as below:</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      services.Configure&lt;RequestLocalizationOptions&gt;(
          options =&gt;
          {
              var supportedCultures = new List&lt;CultureInfo&gt;
              {
              new CultureInfo("en-US"),
              new CultureInfo("en-GB"),
              new CultureInfo("fr-FR"),
              new CultureInfo("es-ES")
              };
  
              options.DefaultRequestCulture = new RequestCulture(culture: "en-GB", uiCulture: "en-GB");
              options.SupportedCultures = supportedCultures;
              options.SupportedUICultures = supportedCultures;
          });
  
      services.AddLocalization();
      services.AddMvc(config =&gt;
      {
          var policy = new AuthorizationPolicyBuilder()
                           .RequireAuthenticatedUser()
                           .Build();
          config.Filters.Add(new AuthorizeFilter(policy));
      })
      .AddViewLocalization();
  
      services.AddSession(options =&gt; {
          options.CookieName = "Intranet";
      });
  }
  
  public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
  {
      var locOptions = app.ApplicationServices.GetService&lt;IOptions&lt;RequestLocalizationOptions&gt;&gt;();
      app.UseRequestLocalization(locOptions.Value);
  
      app.UseSession();
      app.UseMvc(routes =&gt;
      {
          routes.MapRoute(
              name: "default",
              template: "{controller=Home}/{action=Index}/{id?}");
      });
  }
  
  [HttpPost]
   public IActionResult SetLanguage(string culture, string returnUrl)
    {
      Response.Cookies.Append(
        CookieRequestCultureProvider.DefaultCookieName,
        CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(culture)),
          new CookieOptions { Expires = DateTimeOffset.UtcNow.AddYears(1) 
     });
  
     return LocalRedirect(returnUrl);
   }
  </code></pre>
  
  <p>The issues are:</p>
  
  <ol>
  <li>Response does not exist</li>
  <li>LocalRedirect does not exist</li>
  </ol>
  
  <p>I have tried:</p>
  
  <ol>
  <li>HttpResponse, HttpRequest</li>
  <li>LocalRedirectResult</li>
  </ol>