Memcache, Mongodb, or other lithium session database storage

I like working with a lithium card, and I was wondering if there are samples for using MongoDB or Memcache for lithium sessions. Should a new Session Adapter be written?

+5
source share
2 answers

One option is to install the session adapter 'Php'in lithium and pass it 'session.save_handler' => 'memcached'to the configuration parameters that the memcached extension handler will use to store sessions in memcache:

Session::config(array(
    'default' => array(
        'adapter' => 'Php',
        'session.save_handler' => 'memcached',
        'session.save_path' => 'sess1:11211, sess2:11211'
    )
));

http://php.net/manual/en/memcached.sessions.php

I store sessions in MongoDb using an adapter 'Model'(which is available in lab.lithify.me):

Session::config(array(
    'default' => array(
        'adapter' => 'Model',
        'model' => 'app\models\Sessions',
        'name' => 'session'
    )
));

http://lab.lithify.me/lab/extensions/view/a68f6ad626aaf7be37805f8e72f672e2

+4

All Articles