user agent sent to all scripts when loading?

Discussion in 'JavaScript' started by Lafaso870, Apr 30, 2011.

  1. #1
    Just double checking:

    I have a <script> that calls a php file to compose the javascript. Just double checking: when a browser loads content from a <link> or <script> tag, it always sends the appropriate HTTP_USER_AGENT string as well, correct?

    I just want to sure it ALWAYS sends it before i rely on its functionality.

    Thanks
     
    Lafaso870, Apr 30, 2011 IP
  2. rainborick

    rainborick Well-Known Member

    Messages:
    424
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    120
    #2
    Yes, you can rely on HTTP_USER_AGENT always being sent. But you can't always rely on it being accurate. A malicious script can set the HTTP_USER_AGENT field to any value it chooses, so don't use it as a security control. Good luck!
     
    rainborick, Apr 30, 2011 IP