GithubHelp home page GithubHelp logo

kuetrzi / products.beakersessiondatamanager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from collective/products.beakersessiondatamanager

1.0 1.0 0.0 106 KB

A Zope 2 session data manager backed by Beaker

License: MIT License

Python 100.00%

products.beakersessiondatamanager's Introduction

Introduction

Products.BeakerSessionDataManager is a replacement for the default Zope 2 session implementation. It uses Beaker as a backend (via collective.beaker) and adapts the Beaker session to provide the same interface as a normal Zope session.

Beaker is a better alternative to the default session implementation for several reasons:

  • The Zope session implementation does not perform well in high-write scenarios.
  • Beaker provides better flexibility in where session data is actually stored.
  • Beaker is used and maintained outside of the Zope ecosystem.

Note

If you are developing a product that needs sessions but are not already using Zope sessions, you should probably just use collective.beaker directly. This product is meant for use with existing add-ons that already use Zope sessions (i.e. request.SESSION).

Installation

  1. Add the Products.BeakerSessionDataManager egg to your buildout:

    [instance]
    eggs =
        Products.BeakerSessionDataManager
    
  2. Make sure that buildout adds Beaker configuration to zope.conf. For example:

    zope-conf-additional =
        <product-config beaker>
            session.type            file
            session.data_dir        ${buildout:directory}/var/sessions/data
            session.lock_dir        ${buildout:directory}/var/sessions/lock
            session.key             beaker.session
            session.secret          secret
        </product-config>
    

    The "secret" should be replaced with a unique string for your system. It must be the same for all Zope instances using the same session store.

    See the collective.beaker docs for more details on configuration.

  3. In the ZMI, delete the session_data_manager object and add a Beaker Session Data Manager.

Notes

  • Beaker does not automatically clean up old sessions, so you may want to set up a cron job to take care of this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.