This wiki shows how to get the geolocation info of the client using another server API
It could be write also as extension but there are a lots of APIs that change the below code
So, I wrote the below code that works for one of them (using www.geoplugin.net)
After you have setup your Yii2 advanced application, you now have setup your user authentication for both frontend and backend. However, if you have first logged into frontend, and try to access backend from the same client machine, you see no login screen, but find yourself automatically logged in.