• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Missing "Last Activity" for portal users - Idle timeout not working

Captive Portal
2
2
261
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    sceptre357
    last edited by sceptre357 Nov 25, 2023, 3:39 PM Nov 25, 2023, 3:17 PM

    I'm using unauthenticated Captive Portal at a few different sites, mainly to restrict the bandwidth of each user on location to improve wifi accessibility. This works very well for my needs but as a precaution (an prefrance) im using the "Idle Timeout" to clear out the list of unauthenticated users if they haven't been on site for a while (like 7 or 30 days). However, i notice that sometimes a few devices/unauthenticated users never show a last activity. I saw this happening with 2.7.0, 2.7.1 and i think it was also doing this is 2.5.3

    login-to-view

    The problem i have with this is that since there's no last activity, the idle timeout doesnt seem to work and hundreds unauthenticated users start accumulating in the list that dont need to be there. I dont want to use the "Hard Timeout" option (which does work) because i dont want the users to be prompted with the portal if they're actively or regularly using the connection, its just an unnecessary inconvenience for the them.

    Why does this happen? Is this a known bug?

    G 1 Reply Last reply Nov 27, 2023, 9:17 AM Reply Quote 0
    • G
      Gertjan @sceptre357
      last edited by Gertjan Nov 27, 2023, 9:46 AM Nov 27, 2023, 9:17 AM

      @sceptre357 said in Missing "Last Activity" for portal users - Idle timeout not working:

      Why does this happen? Is this a known bug?

      Hummm.
      Shouldn't happen.

      Long story short :

      [23.09-RELEASE][root@pfSense.bhf.tld]/root: ps ax | grep prunecaptiveportal
       3852  -  Is       0:00.00 /usr/local/bin/minicron 60 /var/run/cp_prunedb_cpzone1.pid /etc/rc.prunecaptiveportal cpzone1
       4060  -  I        0:00.86 minicron: helper /etc/rc.prunecaptiveportal cpzone1 (minicron)
      97982  0  S+       0:00.00 grep prunecaptiveportal
      

      This says : the portal is 'pruned' every 60 seconds.

      This is the prune function : captiveportal_prune_old()

      Your situation is handled here : in this function. If traffic is 'not known' (zero) the "Last activity" (a time stamp) can't be determined. In that case, the "Session start" time/date is taken, the timeout value (soft time out or hard time out) is added, and that's the 'prune' time. If this prune time is smaller as the actual time, the user is disconnected.

      Btw : what is the DHCP lease time for your captive portal ?
      How many potienta portal devices ?
      How big is the DHCP pool size ?
      If a devices looses the lease, as it went away for the day, and came back the next day, and the lease (IP) was already assigned to another device at that moment, the portal starts to loose track of who is what when etc.

      edit :

      You don't see these "IDLE TIMEOUT" lines :

      login-to-view

      @sceptre357 said in Missing "Last Activity" for portal users - Idle timeout not working:

      im using the "Idle Timeout" to clear

      You've set the Idle timeout set to something like this :

      login-to-view

      What is the value you have set ?

      No "help me" PM's please. Use the forum, the community will thank you.
      Edit : and where are the logs ??

      1 Reply Last reply Reply Quote 0
      2 out of 2
      • First post
        2/2
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.