def clearsession(): # Clear the session session.clear() # Redirect the user to the main page return redirect(url_for('main'))