As you know Facebook saves login sessions and we can see them in settings where we’ve logged in.
Now, they show IP address, Phone name (if logged in with phone) and App name in the phone and Browser name in case we use browser.
I want to store these info for my site using PHP and JavaScript. One way is to use inbuilt features of PHP on server side to save this info to my DB when user logs in successfully.
But there’s a problem in it. The feature gives a string and I find it hard to extract the browser name, OS name and device name. Further, it doesn’t show me app name in case logged in to my service with app.
So is there any better and recommended way to do it? Wouldn’t it be better if I handle this client side? The client that makes request to server it self sends Device name, OS name and other info.
2nd option seems to me better but I’m not sure if it actually is.