Using ApplicationDbContext in Repository Pattern

I want to implement repository pattern in my ASP.NET MVC project. I’ve seen a lot of implementations when searching google and I’m a little bit confused. Most of them created their own Context class which inherited from DBContext class and then injected it in a repository (or repositories) constructor.
None of the articles I found explain why the custom DBContext class is created and why they just don’t use default ApplicationDbContext and HOW to change your app code to adapt to the new Context class. They don’t even mention the class.

Can’t login after adding configure application cookies

I’m developing Asp.Net Core 3.1 MVC web application with Identity. My login page works fine but after adding the services.ConfigureApplicationCookie it not worked as expected and it keeps redirecting me to my local index. I can’t figure out what really happen. If I comment this block, everything works as expected.