Jump to content

[SOLVED] Cookie Tracking


dt_gry

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.