Question

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

Was it helpful?

Solution 2

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top