Uniquely identify one computer

I work at a university and I am implementing a PHP web application that should have different behavior when it is visited from one specific computer. The problem I am facing is that from the web server, using $ _SERVER ['REMOTE_ADDR'] and gethostbyaddr (), I can only determine the router that the computer goes through and not the specific username.

Is there anyway, I can establish that one particular computer identifies itself on the server so that the server knows when the web client is accessing from this machine? The computer starts firefox in kiosk mode, so add-ons or greasemonkey scripts are allowed ...

+6
firefox php
source share
9 answers

You can set a cookie. This will be remembered by the client and transmitted to the server as part of each request. Further information here: http://www.w3schools.com/PHP/php_cookies.asp

+12
source share

To change the header of the Firefox agent to uniquely identify this machine, you can extract this line in PHP with $_SERVER['HTTP_USER_AGENT'] .

See How to edit a User Agent string.

+7
source share

You can set a cookie, or alternatively, you can change the UserAgent header that your Firefox installation uses for something different.

To change the User Agent line, simply enter about: config as the address in the FireFox address bar, where you usually enter the URL (link). I recommend that you keep the original value, which you can get when you type approximately: in the address bar.

Now press the right mouse button to get the context menu and select "String" from the "New" menu item. Enter the preference name "general.useragent.override" without a quote. Then enter the new user Agent value that you want Mozilla Firefox to use. I have added my name and link to my website to the original value. You can also select one from the User Agent Lines list. Check the new value by typing about: in the address bar.

You can get this User-Agent string from $_SERVER['HTTP_USER_AGENT'] in php.

+4
source share
+3
source share

Some thoughts:

  • Set a strong cookie. (Since FF is in kiosk mode, you should be safe from users cleaning it.)
  • This kiosk uses a different URL (possibly with a query string parameter).

What I did not do is work according to the MAC address of the machine (which Gibson tells us, maybe) or the like; too fragile when the hardware is fixed, etc.

+2
source share

Why not introduce an authentication system and place those users who need special functionality in a special group?

+1
source share

I am sure that you have a very good answer, but if you are looking for a solution that uniquely identifies the COMPUTER and not the VIEWER, then look at the FLASH COOKIES aka FLASH SHARED OBJECTS.

Abstracts are more efficient and can be used to store data up to 100 KB and remain unchanged in all browsers with flash, so this is the best solution for unambiguous user identification.

0
source share

Try it.

 $something=$_SERVER['HTTP_USER_AGENT']; 

To uniquely identify a user check $something matches your own. (which is in your php code). if so, access.

0
source share

Don't have a SessionID? Your session ID must be unique in order to identify your computer.

-4
source share

All Articles