How to customize the user session timeout (aka auto-logout on inactivity)

  1. ssh as root to the C2 server
  2. Edit /var/opt/cloudbolt/proserv/customer_settings.py
  3. add a line to the file:
    • SESSION_COOKIE_AGE = 60 * 30  # 30 minute inactivity timeout
    • That will set the user timeout in seconds. in this example the users will be logged out after 30 minutes of inactivity
  4. Restart apache: service httpd restart

TIP: To test that this is working, you could set the timeout to 2 seconds, ensure that you are auto-logged out very quickly after logging in, and then adjust the timeout to something appropriately higher.

Have more questions? Submit a request

6 Comments

  • 1
    Avatar
    Kyle Rimkus

    Hi Nils,

    They are related, but slightly different.

    The SESSION_COOKIE_AGE will enforce a timeout from the server. So if the user hasn't made a request in that amount of time, their cookie will have expired and they will be asked to log back in the next time they try to load a page.

    The "Inactivity timeout minutes" setting will tell javascript to log the user out in any open windows. That will also expire their cookie and force them to log back in just like if their cookie expired, but it also actively redirects open windows to log out.The purpose is to not leave possibly sensitive data on the screen, much like how most bank websites behave. But, both timeouts are necessary, as the javascript redirect would only happen if there was an open window.

  • 1
    Avatar
    Nils Vogels

    Isn't this also caught by the setting on /admin/misc_settings/ called "inactivity timeout"?

  • 0
    Avatar
    Bernard

    Steve,

    Yes, it does. The /var/opt/cloudbolt/proserv/customer_settings.py file is not altered during upgrades and the settings in there will still take effect afterwards.

  • 0
    Avatar
    Nils Vogels

    Thanks! It appears I need to make some changes to my customer_settings :)

  • 0
    Avatar
    Steve Paige

    Excellent, thank you Bernard!

  • 0
    Avatar
    Steve Paige

     Does this setting survive CloudBolt upgrades?  

     

Please sign in to leave a comment.