Use session.clear() sign-out.

NOTE: you can not test that the session is cleared out by checking the session cookie does not exist on the index page,
because ItsDangerousSession will create a new session when it hits the index page. The unit test confirms that the session has been cleared.
This commit is contained in:
Rebecca Law
2016-02-12 15:06:54 +00:00
parent 8d1cd930ef
commit 035d4152fd
2 changed files with 4 additions and 4 deletions

View File

@@ -8,7 +8,6 @@ from app.main import main
@main.route('/sign-out', methods=(['GET']))
@login_required
def sign_out():
if session.get('service_name', None):
session.pop('service_name')
session.clear()
logout_user()
return redirect(url_for('main.index'))