Logout a User
When all the fun is over, a user logs out by clicking the logout link at the top of the page, which sends a
GET request to the
@app.route('/logout', methods=['GET']) def logout(): session.pop('username', None) flash('Logged out.') return redirect(url_for('index'))
username from the
session object and takes the visitor back to the home page.