Help me about this function!

I’m designing a website with PHP . I want to create the web just running on the only browser at the same times and when users haven’t signed out since they logged in.
I heard there is a command called ''get_browser()",Can you help me understand more about this ???
Thank you !

Have a look at the PHP Manual get_browser().

The web-page has quite a few helpful examples and user notes.

3 Likes

And if you already read that page, and still need more help, then please explain a bit more in detail what you want to do?

That command just gets the useragent. The useragent can be set by the usere to anything they like and so cannot be relied on to distinguish between browsers. I have all the browsers on my computer set to use the same useragent.

The only legitimate use for that field is for gathering statistics where the inaccuracy in the results doesn’t matter. It should not be used for any other purpose.

If you want to stop a logged in account being swapped between browsers then having something on the server to record that they are logged in and using a session or cookie passed to the browser to also keep track will always properly detect if they try to log in from another browser because the server will show they are logged in but the appropriate session or cookie will not exist.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.