from flask import redirect, session, url_for

@app.route('/')
def index():
    return 'foo'

@app.route('/is_logged_in/')
def is_logged_in():
    user = session.get('user', None)
if user:
    return user
return redirect(url_for('index'))
Flask with a webserver breaks all sessions?