View Single Post
  #3 (permalink)  
Old 07-01-08, 12:46 PM
ramush ramush is offline
New Member
 
Join Date: Jun 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
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)?
Reply With Quote