I am creating a web application named Online Exam using PHP+MySQL and AngularJS. Now I am getting some trouble on project like changing the user looged in status. Let us take this condition as a example:
- Suppose a authorized user/student successfully logged in online exam section(After successfully logged current time will be inserted in the db in
exam_start_timecolumn as unix timestamp format andexam_statuswill be set as 'ACTIVE`. - 1hr(60 min) countdown timer is initialize for him/her as per the inserted
exam_start_timein db. - Now suppose after 15 min the system shuts down automatically, then if user logged in again(In same system or other) then the countdown timer should be set for 45 minutes only.
- Previously I was updating the
last_activity_timein our table in every 10 sec(using ajax calls). but now I want to change this way, Is there any way like(socket or network programming using PHP) to update the column.
Here is my table structure which is managing user logged in status

Please give me some suggestions on it.