pallets-eco / flask-session

Server side session extension for Flask
https://flask-session.readthedocs.io
BSD 3-Clause "New" or "Revised" License
501 stars 239 forks source link

FileSession time is too short #21

Closed viweei closed 8 years ago

viweei commented 9 years ago

FileSession time is too short, I found in the File

sessions.py at line 297

self.cache = FileSystemCache (cache_dir, threshold = threshold, mode = mode)

Missing parameters default_timeout, because FileSystemCache default value is 300 seconds. look at

class FileSystemCache(BaseCache):
   """
   ....
   """
    #: used for temporary files by the FileSystemCache
    _fs_transaction_suffix = '.__wz_cache'

    def __init__(self, cache_dir, threshold=500, default_timeout=300, mode=0o600):
        BaseCache.__init__(self, default_timeout)
        self._path = cache_dir
        self._threshold = threshold
        self._mode = mode

So I think we should use Flask parameter "PERMANENT_SESSION_LIFETIME"

fengsp commented 8 years ago

We are always using PERMANENT_SESSION_LIFETIME so far.