Change default session timeout

This commit is contained in:
Taylor Helsper 2021-03-28 11:21:45 -05:00
parent 0e45296708
commit 2f6e9679a5
4 changed files with 7 additions and 4 deletions

View File

@ -145,6 +145,8 @@ def api_homepage_needs_refresh():
@mynode_api.route("/api/get_qr_code_image")
def api_get_qr_code_image():
check_logged_in()
img_buf = cStringIO.StringIO()
url = "ERROR"
if request.args.get("url"):

View File

@ -723,10 +723,10 @@ def get_flask_session_timeout():
h = parts[1]
return int(d),int(h)
else:
set_file_contents("/home/bitcoin/.mynode/flask_session_timeout", "90,0")
return 90,0
set_file_contents("/home/bitcoin/.mynode/flask_session_timeout", "7,0")
return 7,0
except:
return 90,0
return 7,0
def set_flask_session_timeout(days, hours):
set_file_contents("/home/bitcoin/.mynode/flask_session_timeout", "{},{}".format(days, hours))

View File

@ -59,6 +59,7 @@ app.config['DEBUG'] = False
app.config['TEMPLATES_AUTO_RELOAD'] = True
app.config['MAX_CONTENT_LENGTH'] = 32 * 1024 * 1024 # 32 MB upload file max
app.config['UPLOAD_FOLDER'] = "/tmp/flask_uploads"
app.config['SESSION_PERMANENT'] = True
app.config["SESSION_COOKIE_NAME"] = "mynode_session_id"
app.secret_key = get_flask_secret_key()
timeout_days, timeout_hours = get_flask_session_timeout()

View File

@ -536,7 +536,7 @@
<div class="divider"></div>
<div class="settings_block_subheader">Automatic Logout</div>
Your myNode will logout automatically after a period of time. It can be changed below.
Your myNode will logout automatically after a period of inactivity. It can be changed below.
<br/><br/>
<form action="/settings/logout_time" method="POST">