User Agent

What is a user agent?

A user agent is a specific field in the HTTP request that contains information about the client. The server looks for specific words within the text and ignores everything else, so based on what the server does or doesn’t find in the user agent text, the server builds out the content optimized for the client. The user agent includes:

  • Browser type and version

  • Operating system and version

  • Rendering engine

To confuse things, you will see that user agents include pieces of information like the text “Mozilla/5.0” (found in most browser user agents) that just signals the server that this client is compatible with that browser. The user agent in the following example is for a 64-bit Windows 10 desktop machine using a Gecko rendering engine running on a Firefox 57 browser.

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0

The Chrome user agent tells the server that it is a Mozilla/5.0 browser, a Safari browser, and a Chrome browser as you can see in the user agent below.

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36

read more