Build encapsulated components that manage their own state, then compose them to make complex UIs.
Since component logic is written in Java Script instead of templates, you can easily pass rich data through your app and keep state out of the DOM.
We are using the all Cookies() and write Cookie() functions from the prior examples so the only piece of new code we need in order to actually do the update is in the last two lines.
Let’s walk through this by updating Bootstrap with Visual Studio 2017.
NET Core 2.2 project templates include four Java Script / CSS libraries by default including Bootstrap, j Query, j Query Validation and j Query Unobtrusive Validation.
These will quickly become out of date and at some point you will need to update them, at a minimum to get any security patches.
This means that we need to read the existing cookie before we can write a replacement for it.
One thing to note is that when we read a cookie we have no way of telling when the existing cookie is due to expire or whether the cookie is restricted to a specific folder or available across the entire domain.