From the course: ASP.NET Core Identity: Authentication Management
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Cookie policy middleware - ASP.NET Core Tutorial
From the course: ASP.NET Core Identity: Authentication Management
Cookie policy middleware
- [Narrator] The Cookie Policy Middleware is used to enable policy capabilities for cookies in an application, and to control the properties of a cookie processing we can pass as a parameter to a Cookie Policy Middleware. The Cookie Policy Options. And the Cookie Policy Options has five properties. These are Http Only which defines if a cookie should be accessible only to servers or not. The other one is the Minimum Same Site Policy, which affects the cookies same site attribute. Another one is the On Append Cookie, which is called when a cookie is appended and On Delete Cookie which is called when a cookie is deleted. The last one is the Secure property, which affects whether a cookie must be secure or not. So let us go to visual studio and see how we can configure Cookie Policy Middleware. In visual studio go to the startup.cs file, and scroll down to the configure method. Inside this method after the use authentication which is in line 94. We need to add our Cookie Policy…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.