How can I detect if users access a page for the first time? I want to redirect them to their language using GeoIP.


For authenticated users you can use a table where you write a record for each user who visits a page; in the case there isn't a record for the currently logged-in user, you create the record, and then redirect the user.

For the anonymous users, you can register the IP from which they connect, and remove the record after X hours, as the same IP can be used from different users, especially from users with a dynamic IP.

|improve this answer|||||

I wrote a session variable that is set true if access has been made. Did my function in if, using isset function detected if its already set or not. Don't have to make it complicated using tables and other things.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.