Flask keeps spitting out this error:

`TypeError: '<=' not supported between instances of 'NoneType' and 'datetime.datetime'`.

Apparently the flask-session module is trying to compare session expire with current time. I tried setting the session expire to one day to avoid its value from being None, but it doesnt seem to work. If we get the session expire to be of set value, I think it might fix the problem.

![Error](https://i.stack.imgur.com/FUbuq.png)

```
from flask import Flask
from pymongo import MongoClient
from flask_session import Session
import datetime
from flask_wtf.csrf import CSRFProtect
from dashboard import dashboard
from auth import auth

app = Flask(__name__)
app.config['SECRET_KEY'] = 'xxxxx'
app.config['SESSION_TYPE'] = 'mongodb'
mongo = MongoClient('mongodb+srv://xxxxxxxxx')
app.config['SESSION_MONGODB'] = mongo
app.config['PERMANENT_SESSION_LIFETIME'] =  datetime.timedelta(days=5)
app.config['SESSION_MONGODB_DB'] = 'matjari'
app.config['SESSION_PERMANENT'] = True
Session(app)
csrf = CSRFProtect(app)
matjari = mongo.matjari
mongo_users = matjari['users']

app.register_blueprint(dashboard, url_prefix='/dashboard')
app.register_blueprint(auth, url_prefix='/auth')

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

if __name__ == '__main__':
    app.run(debug=True)

```