session: Add support for Memcache as a session backend #2031

merged 3 commits into from May 13, 2015


None yet

2 participants


This adds support for Memcache server(s) as a session storage backend. This is useful for higher traffic sites as it removes a database write per request. Therefore, read requests can be truly read; without database writes. Multiple Memcache servers are supported and used redundantly so that as long as at least one Memcache server remains reachable, session data will not be lost before it expires.

greezybacon added some commits May 8, 2015
@greezybacon greezybacon session: Add support for Memcache as a session backend 282c0fb
@greezybacon greezybacon autocron: Release agent session before running
The PHP session system will hold a lock on the session until it is released.
It is important to release the session before performing long-running tasks
so that further requests from the agent are not locked.
@greezybacon greezybacon commented on an outdated diff May 12, 2015
- array(&$this, 'gc')
- );
- //Start the session.
+ if (!defined('SESSION_BACKEND'))
+ define('SESSION_BACKEND', 'db');
+ try {
+ if (!class_exists(self::$backends[$bk]))
+ $bk = 'db';
+ $this->backend = new self::$backends[$bk]($this->ttl);
+ }
+ catch (Exception $x) {
+ // Use the database for sessions
+ $this->backend = new self::$backends['db']($this->ttl);
greezybacon May 12, 2015 Member

Emit a PHP warning here

@protich protich merged commit 27f80cc into osTicket:develop May 13, 2015

1 check failed

continuous-integration/codeship Build failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment