Jump to content
BrainPill

can php always parse most browser values with get_browser()?

Recommended Posts

Is it possible that there are cirumstances under which there is no output for the value ['browser'] or ['parent'] when using : get_browser(null, true); ?

If so, can someone explain when and which situations cause that?

Share this post


Link to post
Share on other sites

No , what is written under 'Notes' is not what I mean because I have browscap installed. 

So when browscap  installed, is it then still possible to get empty values?

 

Edited by BrainPill

Share this post


Link to post
Share on other sites

Goody goody for you! you have browsercap installed, unfortunately the link I gave does not refer to installation of browsercap, but! The configuration of php.ini AFTER installation for it to work properly.

Share this post


Link to post
Share on other sites

It works for me.

But I am testing localhost how a visitor counter has to work properly.

I add visitors to a database.table based on cookie. If there is no cookie I use ip number AND browser type (get_browser)

But there are many users that hide their ip or username. So my question is : can a website visitor hide the browser type by sending an empty value or is the get_browser() output then sending a fake / other browser name? get_browser parses then fake values of other browsers.

Is that possible?

 

Share this post


Link to post
Share on other sites

If you're relying on the user-agent header, then yes that can be altered or removed completely.  Any data that the user sends is prone to being altered.  Unless you're passing a custom value to get_browser all it does is try to make sense of the user-agent header based on the information that it has.  The user-agent header is supposed to contain information about the browser but, like most other headers, it can be changed or removed.  It's not required for an HTTP request.

Share this post


Link to post
Share on other sites

I still have  questions open for the visitor counter I am making.

I now base a visit on a cookie, together with either an ip number or a get_browser() value;  by placing it in the database table, distinguishing it in different time units.

 

But what would you suggest to do when none of the above params is available? 

Is there an alternative?

Can I use the headers for counting visits?

And how is that done?

Share this post


Link to post
Share on other sites

You could use localStorage in Javascript to track people, or there are other client-side methods to do the same thing.

Look into browser fingerprinting.  There is a lot of information exposed by the browser through Javascript which can be used to uniquely identify a particular computer.  That's one of the ways that something like Google Analytics would use to distinguish individual visits.

Share this post


Link to post
Share on other sites

How unique it is depends on what you've done to your computer.

https://panopticlick.eff.org

Using that, my browser happens to be unique among the ~300,000 or so they've tested.  A browser would not be unique if someone was using the default installation of IE/Edge on the most popular version of Windows.  They probably see a lot of those.  If any options which control web behavior are changed, or plugins are installed, or a bunch of fonts are installed, or any number of other things, it gets more and more unique.

Is it as unique as uniqid() ?

No, uniqid is supposed to be guaranteed to be unique (or, at least, it will take a long, long time before you get a collision).  The total number of values possible for uniqid is greater than the total number of possible browser configurations.

Share this post


Link to post
Share on other sites

What are the best steps to set?

Do it yourself or find a tool online?

Is it a lot of work to do yourself as a programmer? Which skills are needed?

Are there good maintained tools online that other people also use for browser/canvas fingerprinting?

Share this post


Link to post
Share on other sites

I haven't done all of the research on this, I just know it's out there.  It's for you to do the research and decide if you want to use it to meet your own needs.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...