5

Products.Sessions · PyPI

 3 years ago
source link: https://pypi.org/project/Products.Sessions/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Overview

Zope server side session management.

This package contains Products.Sessions and Products.Transience.

Using sessions under Zope 4

The default session support under Zope 2 relied on Products.TemporaryFolder for storing session data, which in turn used the tempstorage package. tempstorage is no longer recommended because it has unfixed and possibly unfixable issues under Zope 4 that lead to corrupted temporary storages.

If you use sessions sparingly and don’t write to them often, a quick workaround is to remove the existing /temp_folder instance in the ZODB if it still is a Temporary Folder and create a normal Folder object named temp_folder in its stead. Inside that new /temp_folder, create a Transient Object Container with the ID session_data. Now session data will be stored in the main ZODB.

If you use sessions heavily, or if the workaround above leads to an unacceptable number of ZODB conflict errors, you should either try using cookies or local browser storage via Javascript for storing session data, or switch to a different session implementation that does not store session data in the ZODB at all. See the Zope book on Sessions for details.

Using sessions under Zope 2

If you use the standard Zope session implementation, don’t forget to add or uncomment the temporary storage database definition in your Zope configuration:

<zodb_db temporary>
    <temporarystorage>
      name Temporary database (for sessions)
    </temporarystorage>
    mount-point /temp_folder
    container-class Products.TemporaryFolder.TemporaryContainer
</zodb_db>

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK