I am new to the backend and I don’t know much about it. I make a small layout of the site, so for experience and practice. I want to automatically authorize users after exiting the browser and similar situations. You can, of course, write the password and login in cookies and check them with the database, but I want to delve a little into security. A hashed password is also not the most reliable thing, as I understood. Through a search on the Internet, either choked on terminology or found the same solutions.
For starters, I wanted to get around the situation with simply copying cookies to another device. Use session is not an option, because it is removed (although I may not know something). You can write to the cookie is not a login-password, but a token. But it can also be copied. Judging by the same articles from the Internet, it is also bad to ip to ip, because it can change. As an option - to save some kind of token and periodically change it. But in this case, the authorization can be done only on one device, but I want to not. So how can this be realized?