Internal Server Error when using Flask session

According to Flask sessions documentation:


What this means is that the user could look at the contents of your
cookie but not modify it, unless they know the secret key used for
signing.

In order to use sessions you have to set a secret key.

Set secret key. And you should return string, not int.

#!/usr/bin/env python

from flask import Flask, session

app = Flask(__name__)

@app.route("https://stackoverflow.com/")
def run():
    session['tmp'] = 43
    return '43'

if __name__ == '__main__':
    app.secret_key = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'
    app.run()

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)