From the course: Securing ASP.NET Core Apps: Advanced Techniques for Web Application Security

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Cookie-based authentication

Cookie-based authentication

- [Instructor] Cookie-based authentication is an important authentication type where the necessary identity information of a user is stored in a cookie. But how does this work? Let us say you navigate a website which is asking for user credentials. You have to provide the username and password, and click the login button. A request will be sent to the server which is going to validate the user credentials. If the user credentials are valid, that is going to create a session and return the session ID to the browser. Now the browser is going to store this session ID in a cookie. So that is why we call this authentication type, the cookie-based authentication. Now, this session ID is sent with each request to the website, which is checked against the active session IDs in the server, and if valid, you'll get some data, otherwise, you'll be asked to provide your credentials again. Now, let us go to Visual Studio and…

Contents