Live data from Hacker News

Ask HN: How to recognize web logins from new devices?

news.ycombinator.com

1–5 of 5 posts

Re: Ask HN: How to recognize web logins from new devices?

#3

What 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.

what you put in that cookie and how did you matched on server side? could you share some pointers?

Re: Ask HN: How to recognize web logins from new devices?

#4
post #3

What 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.

what you put in that cookie and how did you matched on server side? could you share some pointers?

For 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.

Re: Ask HN: How to recognize web logins from new devices?

#5
post #3

Earlier quoted context omitted.

what you put in that cookie and how did you matched on server side? could you share some pointers?

For 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.

sounds good!