Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

session is saved before @after_request callbacks #351

Closed
matejcik opened this Issue · 0 comments

2 participants

@matejcik

This makes it impossible to add data to session in said callbacks. For example, the following code does not work, because session is never stored:

@app.before_request
def before_request():
    u = session.get('user')
    g.user = u and db.User(u) or None

@app.after_request
def after_request(response):
    session['user'] = g.user and dict(g.user) or None
    return response
@mitsuhiko mitsuhiko closed this in d628df6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.