Detecting user site visits I some working code in hook_user_login() that awards 5 points to users for each day they log into the site.  If they log in twice in one day, points are not awarded the second time.

Originally, I thought users would login each time they visit the site but since users stay logged in between visits, they are not getting points for visiting once per day.  For example, if they log in today, they get 5 points but tomorrow and each day they visit thereafter, they don't receive any.

I would like users to be awarded for each day they visit the site whether they need to log in or not.  I wasn't able to find another hook that could do it.  Does anyone know of one or some other method of tracking user visits?
You could store the last updated timestamp in the session on login, and then check it on each page load to see if it's within your parameters:

function MYMODULE_init() {
  // Only proceed if there's a timestamp in the session. Otherwise defer to
  // hook_user_login() to take care of setting that.
  if (user_is_logged_in() &amp;&amp; isset($_SESSION['MYMODULE_point_check_timestamp']) {
    // If the timestamp is more than 24 hours ago, award more points.
    if (REQUEST_TIME - $_SESSION['MYMODULE_point_check_timestamp'] &gt; (60 * 60 * 24)) {
      award_points();
    }
  }
}

function MYMODULE_user_login(&amp;$edit, $account) {
  award_points();

  // Track the time points were awarded.
  $_SESSION['MYMODULE_point_check_timestamp'] = REQUEST_TIME;
}

function MYMODULE_user_logout($account) {
  // Clean up.
  if (isset($_SESSION['MYMODULE_point_check_timestamp'])) {
    unset($_SESSION['MYMODULE_point_check_timestamp']);
  }
}