Great. I created the table.
1. I have one file called check_password to confirm the user can login
2. Now I created a new file check_session.php which is included in each internal page.
Now I need the code for check_session.php please:
1. Check if there is a session for this user > how?
2. If not, create a session > how? insert to sessions? how do I pass the user_id variable from check_pass to check_session?
3. If there is a session, how do I compare the user session id to the one I stored in my db? get session_id?
4. How do I write a cron job to clear records that have not been updated for X minutes (perhaps 20 mins)?