dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
1179
share rss forum feed


johnnyboyct

join:2003-06-11
New Britain, CT

Javascript or PHP method of getting a repeatable unique iden

Hey guys, I havent posted in a REALLY long time so forgive me for not helping out.

I am currently looking for some kind of ID that would identify a users machine or the user or something similar that every time (without logging in to any login system) they can get an id that is directly related to them, the same id every time though. That may not make sense so read on...

Basically I want them to get the same id every time they hit a page for a kind of analytic portion of an app im writing. I have access to server side scripting and javascript, quickest and easiest for me is PHP and I've been looking into that as well, but cant seem to find a way to make that unique ID repeatable.

Basically in a perfect world I would want the computer name and then I could combine it with the ip, but I don't think there is anyway I can do that.

I don't really want to rely on cookies and that's why I want to try to make this repeatable id, and I know its a long shot, but is there something in a tech that I might not know so well (maybe flash or something) that will be able to get an id over and over for that machine/user/mac address each time they visit the page? I was also thinking of a set of values or something that could get concatinated that could be maybe not 100% accurate, but for the most part ending up unique in the vast majority of cases.

I will also be storing a typical GUID for the session (thats done already), but the hard part is Id like the other ID to be somehow related to the USER, PC, MAC, etc.

TLDR: Does anyone have any ideas on how I can get a repeatable identifier (same string when visited by the same machine or user every time they hit the page)? Is there a technology that I may not have thought of that might be able to do this that is mostly cross browser that can do this, I think I've run out of java script options, maybe something like flash or HTML5 (though I would like it to be pretty cross browser accessible) or maybe even some kind of API or service?

Is there a bunch of fields that would somewhat reliably be able to be concatenated and encoded, even if its not 100% foolproof? Can flash or some other tech grab anything unique to the machine or something? Is there any other somewhat non standard tech that might be able to do this, like action script or VBScript (though I dont even know if that still works lol) or something along those lines?

Thanks a lot and sorry if I didnt come across clear or the post is too long
--
Connecticut Web Design and Development


cowboyro
Premium
join:2000-10-11
Shelton, CT
Probably a cookie is the best way. Short of that a combo of IP and browser signature, but the browser signature may change. And maybe throw a cookie in the mix and try to re-link them if one is changed.
In order to have access to the hardware you'd need to force the users to install crap on their machines - stuff that normally runs in a browser is pretty much sandboxed these days.


cdru
Go Colts
Premium,MVM
join:2003-05-14
Fort Wayne, IN
kudos:7
reply to johnnyboyct
said by johnnyboyct:

TLDR: Does anyone have any ideas on how I can get a repeatable identifier (same string when visited by the same machine or user every time they hit the page)? Is there a technology that I may not have thought of that might be able to do this that is mostly cross browser that can do this, I think I've run out of java script options, maybe something like flash or HTML5 (though I would like it to be pretty cross browser accessible) or maybe even some kind of API or service?

AFAIK there isn't anything like that for security/privacy reasons. A cookie with a value that you set is the best option, but isn't a perfect solution if the user doesn't allow cookies, deletes them, or it expires. Or if they use a different browser.


johnnyboyct

join:2003-06-11
New Britain, CT
reply to johnnyboyct
Yeah I think im stuck with something random stored in the cookie... Ah well, it kind of sucks, but I dont see any good alternative :/
Thanks guys!