Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-51365

Session TTL set arbitrarily high

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a bug
    • Affects Version/s: 2.9.1
    • Fix Version/s: None
    • Component/s: General
    • Labels:
      None
    • Affected Branches:
      MOODLE_29_STABLE

      Description

      This came up in the dev chat with Jonathan Champ.

      In the session live, session.gc_maxlifetime is (seemingly arbitrarily) set to 4 days:
      https://github.com/moodle/moodle/blob/master/lib/classes/session/manager.php#L256

      This means a few things:

      • You (probably) store sessions for way longer than needed
      • You can't set session timeout to move that 4 days (not that you are likely too...)
      • You can't tell when using sessions like memcache(d) if you have enough memory allotted.
        • Normally you could watch for evictions, and if you have them, you don't have enough memory, but if you have 2 hr sessions, you have 94 hours of bad sessions that may be evicted.

      Looking back at the session rework in MDL-31501, the previous code set session.gc_maxlifetime to sessiontimeout, but when the code was updated, it was just changed to 4 days.

      I understand the theory that we want Moodle session cleanup to take precedence. Personally I would set it to "sessiontimeout + 1hr" or something like that.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              emerrill Eric Merrill
              Reporter:
              emerrill Eric Merrill
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: