Jump to content
Sign in to follow this  

How to track user active time based on session login and logout

Recommended Posts

How to track user active time based on session login and logout.

Basically, I want to get the report that each user login time and logout time/session inactivity time.

Is there any module available or we can use any hooks to simulate the above.

Thanks in advance for your support.

Share this post

Link to post
Share on other sites

If you want to see the current situation real-time, you could install the built-in Session Handler DB module. This changes ProcessWire to use database sessions (instead of storing session data on the disk) and also provides a handy overview under Setup > Sessions that displays currently active users, when they last did something, and where they are on the site right now.

I'm not aware of a module that would track this kind of data in the long term and/or store it in a log file, but I'm guessing that it wouldn't be terribly difficult to build one on top of the database sessions module. Someone else might have a better idea about this though.

The Login History module tracks when users last logged in, but it doesn't track logouts, so it's probably not much of a help in this case.

  • Like 3

Share this post

Link to post
Share on other sites

Join the conversation

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

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Peter Knight
      How do you guys handle large session tables when sessions are being recorded to the database?
      I notice one of my sites has a session table of over 14MB 
      Am I missing a way in the Admin or a module to auto-remove any sessions older than X days?
    • By helmut2509
      In my PW-Application there is currently no session timeout.
      I want to set the user session to 60 minutes which means that after 60 minutes of inactivity the user will be redirected to the homepage.
      so I added the following entry to my config.php:
      $config->sessionExpireSeconds = 120; (120 seconds is just for testing).
      But after five minutes of inactivity I am still logged in, there is no redirection.
      Is there anything wrong or did I miss something?
      In php.ini I have the entry:
      session.cookie_lifetime = 3600
    • By franciccio-ITALIANO
      Hi, I need to provide a quite complex user registration form: description, subdescription, drop-down lists etc. 
      Through this registration, users will be able to access and comment.
      If someone responds to their comments, I would like a NOTIFICATION to appear when accessing their panel.
      My social interaction project is just that, it seems simple, I don't need more.
      Now I am undecided whether to use buddypress, elgg, or a native processwire system.
      What do you recommend? 
      If you recommend processwire, which modules should I install?
      Do they work or is processwire too immature for that?
      Translated with www.DeepL.com/Translator (free version)
    • By abdulqayyum
      Dear processwire community,
      i have a problem in loginRegister module, i could not add custom field in login and register page.
      i read from plugin documentation. they are saying.
      " By default, the email and password fields are required for both forms. You may want to add more fields. To do this, you’ll need to add fields to your “user” template. You can add fields to your user template in the admin by going to “Setup > Templates > Show system templates > user”.

      but i could not find similar scenario like “Setup > Templates > Show system templates > user”
      i can see just "Setup > Templates" not seeing "Show system templates > user" in my admin panel.

      Please help me in this case that how i can add custom field in these two page.
      Regards AbdulQayyum

    • By prestoav
      Hi there,
      I have a marketplace site that used the older Fredi module for front end editing so advertisers can create and edit their adverts (in the form of pages). After upgrading to v3.0 of Processwire I'd like to change the editing method for users to the new, core front end editing methods. However, it seems that with this method any editor can edit any page (subject to template restrictions for their user role). Using Fredi I checked the user and created user were equal before displaying edit buttons (clunky but it worked).
      Is there any stock way to restrict front end editing to the creator of the page so that my advertisers can only edit their own ads or should I test for user as before?
      Thanks in advance as always 🙂
  • Create New...