Change default session timeout
This commit is contained in:
parent
0e45296708
commit
2f6e9679a5
|
@ -145,6 +145,8 @@ def api_homepage_needs_refresh():
|
||||||
|
|
||||||
@mynode_api.route("/api/get_qr_code_image")
|
@mynode_api.route("/api/get_qr_code_image")
|
||||||
def api_get_qr_code_image():
|
def api_get_qr_code_image():
|
||||||
|
check_logged_in()
|
||||||
|
|
||||||
img_buf = cStringIO.StringIO()
|
img_buf = cStringIO.StringIO()
|
||||||
url = "ERROR"
|
url = "ERROR"
|
||||||
if request.args.get("url"):
|
if request.args.get("url"):
|
||||||
|
|
|
@ -723,10 +723,10 @@ def get_flask_session_timeout():
|
||||||
h = parts[1]
|
h = parts[1]
|
||||||
return int(d),int(h)
|
return int(d),int(h)
|
||||||
else:
|
else:
|
||||||
set_file_contents("/home/bitcoin/.mynode/flask_session_timeout", "90,0")
|
set_file_contents("/home/bitcoin/.mynode/flask_session_timeout", "7,0")
|
||||||
return 90,0
|
return 7,0
|
||||||
except:
|
except:
|
||||||
return 90,0
|
return 7,0
|
||||||
|
|
||||||
def set_flask_session_timeout(days, hours):
|
def set_flask_session_timeout(days, hours):
|
||||||
set_file_contents("/home/bitcoin/.mynode/flask_session_timeout", "{},{}".format(days, hours))
|
set_file_contents("/home/bitcoin/.mynode/flask_session_timeout", "{},{}".format(days, hours))
|
||||||
|
|
|
@ -59,6 +59,7 @@ app.config['DEBUG'] = False
|
||||||
app.config['TEMPLATES_AUTO_RELOAD'] = True
|
app.config['TEMPLATES_AUTO_RELOAD'] = True
|
||||||
app.config['MAX_CONTENT_LENGTH'] = 32 * 1024 * 1024 # 32 MB upload file max
|
app.config['MAX_CONTENT_LENGTH'] = 32 * 1024 * 1024 # 32 MB upload file max
|
||||||
app.config['UPLOAD_FOLDER'] = "/tmp/flask_uploads"
|
app.config['UPLOAD_FOLDER'] = "/tmp/flask_uploads"
|
||||||
|
app.config['SESSION_PERMANENT'] = True
|
||||||
app.config["SESSION_COOKIE_NAME"] = "mynode_session_id"
|
app.config["SESSION_COOKIE_NAME"] = "mynode_session_id"
|
||||||
app.secret_key = get_flask_secret_key()
|
app.secret_key = get_flask_secret_key()
|
||||||
timeout_days, timeout_hours = get_flask_session_timeout()
|
timeout_days, timeout_hours = get_flask_session_timeout()
|
||||||
|
|
|
@ -536,7 +536,7 @@
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
|
|
||||||
<div class="settings_block_subheader">Automatic Logout</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/>
|
<br/><br/>
|
||||||
|
|
||||||
<form action="/settings/logout_time" method="POST">
|
<form action="/settings/logout_time" method="POST">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user