Skip to content
Pinter Computing

Knowledge Base for IT Professionals, Teachers, and Astronauts

Pinter Computing

Knowledge Base for IT Professionals, Teachers, and Astronauts

  • Home
  • Programming
  • DevOps
  • Project Management
  • Software and Hardware
  • Miscellaneous
  • Egyebek
  • About
  • Experience
  • Education
  • Contact
  • Home
  • Programming
  • DevOps
  • Project Management
  • Software and Hardware
  • Miscellaneous
  • Egyebek
  • About
  • Experience
  • Education
  • Contact
Close

Search

Home/Knowledge Base/Turn off the GDPR cookie notification in a dotnet core MVC web application
Knowledge Base

Turn off the GDPR cookie notification in a dotnet core MVC web application

By Laszlo Pinter
November 29, 2019 1 Min Read
0

The dotnet core MVC web application template adds the GDPR cookie acceptance message to the header of the page template. When the site is hosted with HTTP the accept button does not clear the message resulting an infinite loop, when the user cannot log in and the site continuously asks for the acceptance.

When the site is hosted in a Docker container it is also simpler to instal the SSL certificate on the load balancer and host the site with HTTP on port 80.

We use cookies. To be able to use this site please click the Accept button.

To remove the feature delete the

<partial name="_CookieConsentPartial" />

line from the Views\Shared\Layout.cshtml file.

Without the acknowledgement the dotnet core framework will not save any non essential cookies in the browser, so the session state will stop working.

To tell the dotnet core framework, that the application does not require the user to allow the saving of the cookies set the value of CheckConsentNeeded to false in the ConfigureServices() method, services.Configure<CookiePolicyOptions> { section

options.CheckConsentNeeded = context => false;

To make sure the session cookie is always saved even if the GDPR confirmation is enabled, declare it to essential in the ConfigureServices() method, services.AddSession(options => { section

options.Cookie.IsEssential = true;

Tags:

.NETcoreDocker
Author

Laszlo Pinter

Follow Me
Other Articles
Previous

Read the database connection string and other secrets from environment variables

Next

Docker in Windows 10 via VMware Fusion on a MacBook Pro

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Last Changes

  • Scrappy, the AI hardware robot - microphone November 10, 2026
  • Building Scrappy, the AI hardware robot November 10, 2026
  • LM Studio November 8, 2026
  • Installing and configuring LM Studio Bionic agent harness November 8, 2026
  • Installing and configuring LM Studio for local AI model hosting November 8, 2026

Tags

.NET .NETcore 3Dprinting AI AWS C# Chef cloud DevOps Docker EntityFramework Games Git Go iOS iPad iPhone iPod Java Kubernetes Linux MacOSX MSSQL MVC MySql Node.js Packer PowerShell Python RDS Ruby security Splunk storage TeamCity Terraform TestKitchen Tomcat Ubuntu Vagrant VirtualBox VisualStudio Windows WordPress Xcode

Recent Comments

  • Laszlo Pinter on Turn off the built in touchpad when a mouse is attached
  • Kenneth Bush on Turn off the built in touchpad when a mouse is attached
  • Zengei László on MyHeritage családfa exportálása és küldése emailben
  • Raúl Castillo on DynDns update error
  • MICHAEL on Windows Media Player 12 cannot find the album information

–

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Copyright 2026 — Pinter Computing. All rights reserved.