title: Resetting the expiration time for a cookie in Flask
body: <p>I'm using the the Python web framework Flask.  I use sessions in my app.  For my app called <code>main</code>, I've got the setting <code>main.permanent_session_lifetime = timedelta(days=5)</code>, so that a user will remain logged in for 5 days after logging in.  But even an active user will be logged out after 5 days.  I would like the expiration time to reset each time they visit the site, so you get logged out only after 5 days of <strong>inactivity</strong>.  Most sites work this way.  How do I do that with Flask?</p>