Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7694767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:23:38+00:00 2026-05-31T21:23:38+00:00

I am curious to know if detecting the visitor browser with client-side script is

  • 0

I am curious to know if detecting the visitor browser with client-side script is more reliable than server-side script?

It is easy and popular to get the visitor browser both by PHP and Javascript. In the former one, we analyze $_SERVER['HTTP_USER_AGENT'] sent by the header array. However, header is not always reliable. Can Javascript be more reliable as it get the visitor browser from the visitor’s machine?

I mean is it possible to miss the USER AGENT in header and get the browser by javascript?

UPDATE: Please do not introduce methods such as jQuery as I am familiar with them. I just want to know if it’s possible for header’s user agent to fail when javascript still can detect browser? Comparison of client-side and server-side methods.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T21:23:39+00:00Added an answer on May 31, 2026 at 9:23 pm

    OK. So User-Agent header is not required by RFC

    User agents SHOULD include this field with requests.

    https://www.rfc-editor.org/rfc/rfc2616#section-14.43

    Which means the server side detection is not guaranteed.

    Similarly client side detection typically relies on navigator.userAgent but that is also provided by the user agent (browser or what not) and similarly cannot be guaranteed.

    Thus the answer to your question is 50/50 🙂

    Now, if you are trying to figure out how to handle different browsers – feature detection is your safest bet here – but that’s a different question 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm curious to know if there is an easy way to mock an IMAP
i am curious to know how can i get the database data in xml
I curious to know how the jQuery.load functionality affects page load speeds when reporting
I am curious to know why this is happening. Please read the code example
I'm curious to know about the cost of message dispatch in Objective-C in various
I'm just curious to know about this.When i heard about Spring.net and tried some
I have been curious to know what is the purpose of having a console
I am curious to know what happens when the stack and the heap collide.
I'm curious to know, how many spaces of indentation do you prefer in PHP
I am curious to know how webservers handle file uploads. Is the entire file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.