Originally posted by ScubaKing22
... Sorry for all the questions, but I'll be the first to admit I'm a newbie.
we all were once, and still are in most situations... 😉
here's the answer:
$sid = session_id() ... after you have started the session.
also after starting the session, the hash $_SESSION is available ...
check print_r($SESSION) to view the details.
i think $SESSION['id'] should be the session_id also.
the trick of my script is:
[+] the first query is only executed for one table row, because the $sid is unique for every user being on your site (without thinking of exploits right now, makes it all complicated 😉 ).
[+] the second 'garbage collector' query sets ALL logged's to 0 where the session is 'expired' without looking at the session-ids.
by this way, users being idle longer than 5 minutes will not be marked 'logged==1' anymore.