dt_gry Posted November 10, 2008 Share Posted November 10, 2008 Hi guys, I have my login system setup, I have included the process at the end of this post. What I want to do is if the user has been logged in for X amount of time, I want to copy their info from Active_Users to Activity_Log and automaticley log them out. How would I achieve this? Login Process: the user logs in --> cookie is sent --> record is added to Active_Users table in the DB --> user is forwarded to members area. Logout Process: the user logsout --> record is coppied from Active_Users to Activity_Log --> record is deleted from Active_User --> user is forwarded to logout confirmation page. Thanks guys, any help is really appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/132127-solved-cookie-tracking/ Share on other sites More sharing options...
rhodesa Posted November 10, 2008 Share Posted November 10, 2008 Are you saying you want it to automatically happen behind the scenes when someones session is stale? Or if i'm browsing for 30 minutes, once i try to go to a page after that time limit, it logs me out? for stale sessions, you will have to have a cronjob that goes through and cleans house Quote Link to comment https://forums.phpfreaks.com/topic/132127-solved-cookie-tracking/#findComment-687052 Share on other sites More sharing options...
dt_gry Posted November 11, 2008 Author Share Posted November 11, 2008 Thanks rhodesa, that helps alot. Is cron jobs capable of calling scripts and executing them or would the cron job do all the work? Thanks Again! Quote Link to comment https://forums.phpfreaks.com/topic/132127-solved-cookie-tracking/#findComment-687743 Share on other sites More sharing options...
rhodesa Posted November 11, 2008 Share Posted November 11, 2008 What OS is this on? Cronjob is the scheduling capabilities on linux systems. It's like Scheduled Tasks on Windows. You can use it to run scripts on a schedule. So, what would happen, is you would write a PHP script that would do the clean up, then have cron run the script every 5 minutes or so. Quote Link to comment https://forums.phpfreaks.com/topic/132127-solved-cookie-tracking/#findComment-687778 Share on other sites More sharing options...
dt_gry Posted November 11, 2008 Author Share Posted November 11, 2008 Debian if I am not mistaken. Is there any sites that explain cron that you might suggest? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/132127-solved-cookie-tracking/#findComment-687805 Share on other sites More sharing options...
rhodesa Posted November 11, 2008 Share Posted November 11, 2008 google will give you tons...here is one i found real quick http://www.adminschoice.com/docs/crontab.htm if it's through a hosting service, you might not have direct access to the crontab. read their FAQ/Knowledge Base...there should be something in there Quote Link to comment https://forums.phpfreaks.com/topic/132127-solved-cookie-tracking/#findComment-687814 Share on other sites More sharing options...
dt_gry Posted November 11, 2008 Author Share Posted November 11, 2008 Thanks again rhodesa! Working on it now. XD Quote Link to comment https://forums.phpfreaks.com/topic/132127-solved-cookie-tracking/#findComment-688001 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.