If you want to support multiple locations, you cannot store cookie values ββin your user table. Rather, you should create a new autologin table using cookie values ββand a user ID as primary and foreign keys, respectively. I think this is your idea.
Then, for business purposes, you can record the last time the last value was used to log in. Everything that happens during XX days is deleted, and the user needs to log in again. You can either set up a cron job for this, or run it every time someone signs up with a cookie.
The cron deletion task can handle more records (because no one is waiting for its completion), but for optimization you need an index in the date field (to prevent the table from being scanned).
Caring for the hosting at each login has the advantage that you only need to request cookie values ββfor this user, and due to the restriction of the foreign key, the search is quick. But you can clear the user's current cookies so that you can collect cookies that are never used again.
source share