Ever wondered how a website gets to know the browser you are using or you operating system,location,etc...The answer to this is user agents.The term was coined in the early days of the Internet when users needed tool to help navigate the Internet. Back then, the Internet was (an actually still is) completely text-based, and to navigate the text, text commands needed to be typed into a keyboard. Soon tools were developed to be the user's 'agent', acting on the user's behalf so that the user didn't have to understand the cryptic commands in order to retrieve information. Today, nearly everyone uses a web browser as their user agent.User Agents are basically a string transferred to a website.
User agent's usually contain six parts:
User Agents User agents consist of: application name, application version, compatibility flag, browser name and version, operating system and any extensions installed.
Following images will help you how a user agent works:
Note:I do not own the images.