Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: How do i know if an user is not on my site anymore??

by IndyZ (Friar)
on Mar 08, 2001 at 06:08 UTC ( [id://62931]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to How do i know if an user is not on my site anymore??

Just for the sake of the argument I am going to assume that you want to implement something like the "Other Users" nodelet. There is really no good way to do this. You could make every user log in/out, but users are irresponsible, and would fail to logout.

The usual method is to log what time the user last accessed a page, and then when you need to generate a list of logged in users, you go through the log diplay only users that have logged in in the last N minutes.

If you had the times stored in a database you could do:

SELECT username FROM users WHERE (last_access > $time)
$time would be the current time minus the "inactivity threshold".

--
IndyZ

  • Comment on Re: How do i know if an user is not on my site anymore??

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://62931]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.