4

How can I get the MAC address (or something unique for each pc -at least standard user knowledge level-) from client side with js,flash,java or etc. using a crossbrowser method? You probably know when we are coding a poll we should use cookies to prevent multiple voting. I couldn't find a crossbrowser javascript method (without MS IEs activex). Javascript, java applet or flash files will be welcome. Thank you Caglar

Matt
  • 22,721
  • 17
  • 71
  • 112
caglaror
  • 459
  • 1
  • 13
  • 28
  • Another use case is when a web app needs to remember a file location in the PC's local file system - for example the location of their dropbox root so that a file:/// url can be used for dropbox files. Modern browsers sync cookies which messes up this concept (dropbox files may be in different locations on synced machines); whereas a MAC address based system with cookies would allow a distinction. – amh15 Jun 04 '13 at 15:54
  • Similar question: http://stackoverflow.com/questions/216542/how-do-i-uniquely-identify-computers-visiting-my-web-site – nullability Jul 02 '13 at 20:36

2 Answers2

0

There are no standard Javascript APIs for getting a mac address.

It is possible to get this information using a Java applet, but it would need to be signed and have a policy file in order to access hardware info, and it wouldn't really be transparent to the user. See Getting MAC address on a web page using a Java applet

If you just need to track a client, the most reliable thing you can do is use a combination of APIs available to Javascript to create a persistent cookie. It's possible to create a very resilient cookie using a combination of standard HTTP cookies, session storage APIs, caching tricks, and plugins. Evercookie is a great example: http://samy.pl/evercookie/

Community
  • 1
  • 1
nullability
  • 10,545
  • 3
  • 45
  • 63
0

You can't do that with JavaScript. Otherwise any one can lure you to visit their website will be able to peek your MAC address, and that would be a security issue. You can only do it through plug-ins. And the browser will have to prompt user to explicitly allow that plugin first.