0

I did not find the answer after many of reseaches. My usecase is:

  • User login and register their device, it maybe a phone,a tablet, or a computer.
  • They can purchase and download an item on registered device

I know that Mac Address can not be detected by Javascript, so, is there another way to detect that is 1 of their regitered devices?

Update: Cookie and LocalSorage is the same, because 1 device can use multi type of Browsers IE, Chrome, FireFox... Assume when user register their device, the server will create UniqueID for it and return in JSON format, so the main key is now that how does client webapp save this UniqueID and share it for all browsers?

NamNH
  • 1,580
  • 12
  • 32
  • I don't know if this is good enough, but you could maybe go and check one's user agent string which reports the browser and OS one is using. As for the actual physical specs of the hardware itself, there may be no answer, but what you might want to look into are server environment variables. in PHP you can use `$_SERVER` or maybe even `$_ENV` –  Apr 15 '15 at 02:44
  • I think user agent maybe same on multi devices. It seems I need to create a support native app or service to help client detect device. – NamNH Apr 15 '15 at 02:55
  • True but then that requires the device to have sufficient free memory and storage space for the app to function correctly. –  Apr 15 '15 at 02:57
  • Thanks for your advide ! I forgot that 1 device can use many browsers, so user agent is totally not a correct solution. – NamNH Apr 15 '15 at 03:08
  • 1
    Most websites I see that have a "register device" are simply using cookies and if the cookie is lost the user must then re-register the device. It appears on some sites that let you see this, that the user agent is used as an identifier i.e. You logged in from Chrome on Windows. This lets the user know what device and browser they were using. You can also use this to revoke the cookie. If your site is using SSL then you can set the cookie to only be available over the SSL connection. More information about securing cookies -> http://blog.teamtreehouse.com/how-to-create-totally-secure-cookies – HJ05 Apr 15 '15 at 03:29
  • @HJ05, cookies seem to be good approach, but it's a big problem if oneday, user disable cookie. I think we shouldn't require user has to re-enable it for any reason. And another problem is 1 device can use many browsers, and shared cookies is bad behavior. – NamNH Apr 15 '15 at 04:46
  • @John, Another option is [LocalStorage](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API) which is similar to cookies but stored differently and allows larger objects to be stored. – HJ05 Apr 15 '15 at 04:58
  • @HJ05 Cookie and LocalSorage is the same, because 1 device can use multi type of Browsers IE, Chrome, FireFox... Assume when user register their device, the server will create UniqueID for it and return in JSON format, so the main key is now that how does webapp save this UniqueID and share it for all browsers? Any idea? – NamNH Apr 15 '15 at 06:39
  • The device connects to a website. that website gets the request and can access the mac address of the user(or at least their router). Then have the website pass it on to the server side scripting language you are using to generate your pages. You can then use that to load session storage from a file or database. It might be possible you need to set up some extra configs to enable the passing of that data. – Tschallacka Apr 15 '15 at 06:44
  • Browsers are, essentially, sandboxes you can't "get out of". You'll have a hard time sharing your data across browsers, let alone make it work reliably on all these browsers (if not impossible). I'd try to see if I could change the requirements to either "user account" (not device related) *or* "device + browser combination". – RobIII Apr 15 '15 at 06:46
  • You probably saw this thread but just in case... http://stackoverflow.com/questions/1420381/how-can-i-get-the-mac-and-the-ip-address-of-a-connected-client-in-php. There some relevant discussion there. – billynoah Apr 15 '15 at 06:50
  • also this... http://stackoverflow.com/questions/23822170/getting-unique-clientid-from-chrome-extension – billynoah Apr 15 '15 at 06:53
  • From everything I know there is no way to share data across different browsers due to them being sandboxes as @Roblll has said. Even having an app installed on the device isn't going to help get data into the browser unless you are on a platform that supports plug-ins which at this point is a shrinking set. Also, from my experience there are two levels of auth, the username and password, and the second factor the browser cookie is used to just say this browser is trusted don't ask for second factor, and then the browser's password manager is used to store username and pass to avoid login – HJ05 Apr 15 '15 at 13:28

0 Answers0