Jump to content

Recommended Posts

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!

;D

Link to comment
https://forums.phpfreaks.com/topic/132127-solved-cookie-tracking/
Share on other sites

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

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.

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.