from flask import session


def make_session_permanent():
    session.permanent = True  # Refresh the session timeout on every request
    # if 'user_id' in session and session.get('was_authenticated'):
    #     if session.modified:  # Check if the session was modified
    #         session['was_authenticated'] = True
    # else:
    #     session.pop('user_id', None)  # Clear session
    #     session.pop('was_authenticated', None)
    #     return redirect(url_for('login'))  # Redirect to login page if session expired
