The fact is that I am trying to implement the admin part of the site so that it can be entered from various devices.
When you first log into the admin by using the login and password, a cookie is set on the device (for 365 days), and its hash is placed in a separate database table. When you enter the same username and password from other devices, cookies are also set on them. All cookies are different for different devices, so the next time you log into the admin part, the script scans the database table with cookie hashes. If a match is found - a session is established - no login / password is required.
It's simple. But what if a third party gets access to the login and password? The attacker will enter them on his device and gain access to the admin panel. Of course, if this is detected, the administrator can immediately change the login and password in the database and delete the table with cookies, but the attacker has a session variable and he can do whatever he wants before the session ends.
What are the ways to solve this problem? On well-known web sites, when the user's authentication data changes, the session immediately ends on other devices.