mercredi 28 juin 2017

Python Flask Varying session life time

So I know what sessions are. I know how to make them permanent and how to edit their lifetime. But im making a website that has users. I want to make a remember me button, but I don't know how to proceed. The problem is that I want to make it so that only the
session['loggedin'] is affected. BUT i dont know how to affect the lifetime of only certain sessions. here are 2 ways i know to make ALL sessions permanent. app.config['PERMANENT_SESSION_LIFETIME'] = 1200 and

@app.before_request def make_session_permanent(): session.permanent = True

ps I CANNOT USE FLASK LOGIN. I am using a web hosting service that does come pre installed with flask but does not take (pip) installing modules well.




Aucun commentaire:

Enregistrer un commentaire