passing a user id to user_is_logged_in function I want to use the user_is_logged_in function to determine if a user is logged in but i want to determine if that user is logged in from a cron job/ module.

Essentially i have an array of user id's that i want to loop through to see if the corresponding user is logged in and if so execute some code.

My question is how does one pass an integer to the function to get a true or false from the function? all examples i have seen use the function on a page where the user is viewing to show them content or send message to them. Nothing i can see shows how to use it from a script.

Hope this makes sense.

Madmilner
If you look at the docs you'll see the function comment:


  Determines if the current user is logged in.


Emphasis mine.

So the function simply isn't supposed to do what you want to use it for, you'll need to write something custom

It's pretty easy though, see Get all logged in users in Drupal for some inspiration.