In your custom security manager code that you created, you can add the following code after the logout functions
session.clear()
You need to make sure you have included the session element of flask at the top of your code: from flask import ( redirect, request, session )