4 ms·
Ask HN: How to recognize web logins from new devices?
For my project I want to notify the users by email in case there is a new login from a new device i.e. web browser. How are Google/Twitter/Facebook doing this? Is there a technical article describing this?
- phillipseamore 7y agoWhat I've done in the past is to have an identifier in a cookie or localStorage that isn't cleared on logout. A new device would be one that doesn't have that identifier.
- scrpn 7y agowhat you put in that cookie and how did you matched on server side? could you share some pointers?
- phillipseamore 7y agoFor something really basic a simple hash like "username+my_secret" does the trick and is easy to check with nothing stored on the server side. I however have always created a uuid for each new device login and store in DB so the user can see a list of all devices used to login.
- scrpn 7y agosounds good!