What is the best way to store session geolocation results from an IP address using rails?

I am working on a location based application and I would like to save the user's location from their IP address in rails. I am using geokit at present and I can get the location via the user's IP address, but I am wondering what is the best way to store this information without storing in the database (so that first time / unregistered users can benefit from the location function without registering / login).

The best example I can give is how Groupon or LivingSocial “know” where you first visit your apps. They get your location over IP and probably store it in a session. Is this the best way? If so, how can I do this with rails / geokit?

Let me know if you need more information. Thank!

+3
source share
1 answer

Is there any reason why you cannot insert it into a user session and refer to it in the absence of registration? You can also create a caching table that associates physical IP addresses with locations and also applies to this.

+2
source

Source: https://habr.com/ru/post/1791011/


All Articles