I am using a view to show what users of the website or Online or Offline.

I am using user:online field and global PHP field combination with views PHP

Everthing works perfectly.

However, when a user logs off, they remain online forever, they don't show as offline.

The code is use for global PHP is:

<?php print_r ($row->login); ?>

I hope my explanation is clear enough...