Ylianst / MeshCentral

A complete web-based remote monitoring and management web site. Once setup you can install agents and perform remote desktop session to devices on the local network or over the Internet.
https://meshcentral.com
Apache License 2.0
3.68k stars 511 forks source link

Session time not working as expected #6126

Closed tschettervictor closed 1 month ago

tschettervictor commented 1 month ago

Describe the bug I set the session key to a secure token, and set the session time to 999, but I keep getting logged out just about every day.

Expected behavior I expect that when I set the session time, it will allow me to be logged in indefinitely for the set amount of time without having to log in again.

Server Software (please complete the following information):

OS: FreeBSD Virtualization: jails Network: Reverse Proxy hybrid Version: 1.1.23 Node: 20 Client Device (please complete the following information): iOS 17 safari browser

{
  "$schema": "https://raw.githubusercontent.com/Ylianst/MeshCentral/master/meshcentral-config-schema.json",
  "__comment1__": "This is a simple configuration file, all values and sections that start with underscore (_) are ignored. Edit a section and remove the _ in front of the name. Refer to the user's guide for details.",
  "__comment2__": "See node_modules/meshcentral/sample-config-advanced.json for a more advanced example.",
  "settings": {
    "cert": "redacted",
    "_WANonly": true,
    "_LANonly": true,
    "sessionKey": "redacted",
    "sessionTime": 999,
    "port": 8443,
    "_debug": true,
    "aliasPort": 443,
    "_redirPort": 80,
    "_redirAliasPort": 80,
    "TlsOffload": "redacted",
    "_trustedProxy": "redacted",
    "MariaDB": {
      "host": "localhost",
      "user": "meshcentral",
      "password": "redacted",
      "database": "meshcentral"
    }
  },
  "domains": {
    "": {
      "title": "redacted",
      "title2": "redacted",
      "certUrl": "https://redacted",
      "ssh": true,
      "mstsc": true,
      "minify": true,
      "_newAccounts": true,
      "userNameIsEmail": true,
      "agentInviteCodes": true
    }
  },
  "smtp": {
    "host": "smtp.gmail.com",
    "port": "465",
    "from": "redacted",
    "user": "redacted",
    "pass": "redacted",
    "tls": true
  }
}
si458 commented 1 month ago

Plz can u remember to share ur config.json! It's very important for us to replicate ur environment!

Yes I have spotted this too on the mobile ui but not the desktop ui

Will have a look when i get chance

tschettervictor commented 1 month ago

Sorry, it was copied over and the config.json section wasn't present. Updated

si458 commented 1 month ago

sessionTime is in minutes, so 1440 is 24 hours, 10080 is 7 days

"sessionTime": {
  "type": "integer",
  "default": 60,
  "description": "Duration of a session cookie in minutes. Changing this affects how often the session needs to be automatically refreshed."
}
tschettervictor commented 1 month ago

For some unknown reason I thought it was hours.