HTTP_USER_AGENT blank on https

Posted on 2005-04-12
Last Modified: 2013-12-24
  I have been trying to track down a problem that my application experiences intermittenly.  It appears that it returns blanks in the HTTP_USER_AGENT whenever it comes back from - on https.  It always runs through the same code for every page.  That code contains a check for USER_AGENT to determine if it is a mac.  It appears that when it comes back on https that variable is blank.  Is there another method for use on https?  Or am I just stuck with a default on https?

Question by:JGoyer
    LVL 7

    Expert Comment

    You cannot count on HTTP_USER_AGENT.  This is optional info that, strictly speaking, is not required unless you explicitly bounce the client.  In most cases, people use JS on the client side to identify the browser and return this info with the page.  If this is something that you can't do, you have to use "generic" browser.
    LVL 2

    Author Comment

    How do I use js to get that information?
    LVL 7

    Accepted Solution

    There are a few tricks.  First of all, in some cases the browser name is available via JS on client side.  Also, different browsers use different document models, so usually people check what is working and make decision about the browser.  See JS forums for more details.  As soon, as you know the browser, you can pass the browser type, as a hidden value across your pages and do not rely on HTTP_REFERER, which may or may not be present.
    LVL 2

    Author Comment

    Thanks!  I appreciate the help.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Suggested Solutions

    In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
    Article by: kevp75
    Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now