Вопрос

I am asking a basic question.

Can $_SERVER['HTTP_USER_AGENT'] be same for two different systems if the user does not modify the header information which will be set by the browser?

Это было полезно?

Решение

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9

This is my current user agent. There's nothing in there that's specific to my personal system. Anyone with the same OS with the same browser version will have this same user agent string.

Другие советы

Yes

For example, this is my current user agent:

Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.102 Safari/537.36

The components of this string are as follows:

  • Mozilla/5.0: Previously used to indicate compatibility with the Mozilla rendering engine
  • (X11; Linux i686): Details of the system in which the browser is running
  • AppleWebKit/531.21.10: The platform the browser uses
  • (KHTML, like Gecko): Browser platform details
  • Chrome/32.0.1700.102: Information about the browser.

In short, there's in the above user agent string that's really unique to me. If a different person on the Internet with the same configuration accesses your website, then their user agent will be the same.

See RFC2616 for more information about the structure of User-Agent strings.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top