Fixing information exposure through insecure cookies
Cookies are essential in maintaining state in ASP.NET Core web applications. Sensitive cookies, such as the ones that are used for authenticated sessions should only be transmitted over HTTPS and marked as HTTP-Only
to stop attackers from stealing information stored in these cookies.
In this recipe, we are going to configure cookie policies that will prevent our ASP.NET Core sample web application from generating persistent cookies.
Getting ready
We will use the Online Banking app we used in the previous recipe. Using Visual Studio Code, open the sample Online Banking app folder at \Chapter07\information-exposure2\before\OnlineBankingApp\
.
You can perform the steps in this folder to fix information exposure through the persistent cookies recipe.
How to do it…
Let's take a look at the steps for this recipe:
- From the starting exercise folder, launch Visual Studio Code by typing the following command...