1

I am currently using nodejs as backend and I would like to get a unique device id for each device that access my website. Is there any npm package that do that. I tried node-machine-id but it gave me the same device id when i sumbitted the request through my phone and laptop which are two different devices yet i got the same Id any help

Ahmed
  • 1,229
  • 2
  • 20
  • 45
  • This doesn't have anything to do with Node.js really. Simply generate a random ID and save it in a long-lived cookie. – Brad Mar 04 '21 at 06:14
  • Ok i just wanted to make sure is there an npm package that could detect device id without storing it in a cookie – Ahmed Mar 04 '21 at 06:16
  • There is no inherent device ID. You'll have to create one specific to your application and store it somewhere, such as a cookie or local storage. – Brad Mar 04 '21 at 06:17
  • Ok thank you for you help – Ahmed Mar 04 '21 at 06:18
  • May be check xforwarded it gives you ip for particular request then you can generate random uuid as per the ip – Shubham Dixit Mar 04 '21 at 06:31
  • Quick question is it possile to use mac address as device identifier – Ahmed Mar 04 '21 at 06:46
  • For web based app its all public IP provided by ISP ,you cant get mac address unless the client and server are on same network – Shubham Dixit Mar 04 '21 at 06:48

0 Answers0