Invalid cookies after changing users' passwords
In Asp.Net Core, cookies are validated every 30 minutes by default. This means that when the user logs in to the site and enters their information, the user's current claims are stored in the cookie and can access the pages they want, and the cookies are not validated for up to 30 minutes, eve ....
Read more
A way to restrict APIs that each request can be called with a new key (Time-based One-time Password)
TOTP is an algorithm that uses clocks to generate one-time passwords. In this way, a unique code will be generated at any moment. If you have worked with Google Authenticator, you are familiar with this concept. In this article, we want to implement a scenario in which APIs must send a ....
Read more
بدست آوردن دیتاهای سلسله مراتبی در SQL
ساختار نظرات یک پست را در نظر بگیرید. هر شخصی میتواند برای هر پستی نظر بگذارد و هرشخص میتواند برای نظر دیگری یک نظر جدید وارد کند. نظرات به صورت پدر و فرزندی میباشد یعنی هر نظر میتواند چندین فرزند داشته باشد ولی هر نظر فقط یک پدر دارد و در نهایت میخواهید کل نظرات ثبت شده برای یک نظر خاص ....
Read more
Exception handling in Asp.Net Core 3.1
In this section we want to create a general middleware for error management in the program. This means that when an error occurs anywhere in the program, we can find the error with this middleware and show the appropriate message to the user. The way this middleware w ....
Read more
Introducing Dapper
What is a Dapper? Dapper is a small and very fast ORM developed by Stackoverflow. Dapper works with any type of database and is not specific to a specific database. Using Dapper, you can execute SQL statements as Stored Procedure or as direct SQL statements. If you have to write ....
Read more