Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SecureCookieSessionInterface: cannot import name 'total_seconds' from 'flask.helpers' #13

Open
MarcoBorrini99 opened this issue Sep 5, 2022 · 1 comment

Comments

@MarcoBorrini99
Copy link

I'm actually trying to use the extension in a multi-session environment.

With the following configuration:

import redis
SESSION_CONFIG = [
        # First session will store the password value on it's own cookie.
        {
            'cookie_name': 'fsp',
            'session_type': 'secure_cookie',
            'session_fields': ['password'],
        },
        # Second session will store any other values set on the Flask session on it's own secure cookie
        {
            'cookie_name': 'session',
            'session_type': 'redis',
            'session_fields': 'auto',
            'client': redis.Redis(host='portainer-dc_redis-dc_1', port=6379, db=0)
        }
    ]

my flask app doesn't start with the following log:

/home/marco/PycharmProjects/corkscrew/venv/bin/python /home/marco/PycharmProjects/corkscrew/wsgi.py 
Traceback (most recent call last):
  File "/home/marco/PycharmProjects/corkscrew/wsgi.py", line 2, in <module>
    from app import app
  File "/home/marco/PycharmProjects/corkscrew/app/__init__.py", line 13, in <module>
    from flask_session_plus import Session
  File "/home/marco/PycharmProjects/corkscrew/venv/lib/python3.10/site-packages/flask_session_plus/__init__.py", line 1, in <module>
    from flask_session_plus.session import Session
  File "/home/marco/PycharmProjects/corkscrew/venv/lib/python3.10/site-packages/flask_session_plus/session.py", line 2, in <module>
    from flask_session_plus.backends import SecureCookieSessionInterface, FirestoreSessionInterface
  File "/home/marco/PycharmProjects/corkscrew/venv/lib/python3.10/site-packages/flask_session_plus/backends.py", line 8, in <module>
    from flask.helpers import total_seconds
ImportError: cannot import name 'total_seconds' from 'flask.helpers' (/home/marco/PycharmProjects/corkscrew/venv/lib/python3.10/site-packages/flask/helpers.py)

Process finished with exit code 1

Just before going mad, is flask-session-plus Flask==2.1.3 compatible?

Regards

@alejcas
Copy link
Owner

alejcas commented Sep 5, 2022

I don’t think it’s compatible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants