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

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

    Scheduled Pinned Locked Moved Captive Portal
    2 Posts 2 Posters 324 Views
    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

      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

      b4bc269c-8fc1-4767-b95d-32f3d532d93a-image.png

      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?

      GertjanG 1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan @sceptre357
        last edited by Gertjan

        @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 :

        939affe0-3e4b-4d2c-abaf-1a0fdbbb9d0e-image.png

        @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 :

        c2495265-99e5-4faa-b18c-4bd669d76c66-image.png

        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
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.