get( self::getKey( $id ) ); if ( $data === false ) { return ''; } return $data; } /** * Callback when writing session data. * * @param string $id Session id * @param mixed $data Session data * @return bool Success */ static function write( $id, $data ) { global $wgObjectCacheSessionExpiry; self::getCache()->set( self::getKey( $id ), $data, $wgObjectCacheSessionExpiry ); return true; } /** * Callback to destroy a session when calling session_destroy(). * * @param string $id Session id * @return bool Success */ static function destroy( $id ) { self::getCache()->delete( self::getKey( $id ) ); return true; } /** * Callback to execute garbage collection. * NOP: Object caches perform garbage collection implicitly * * @param int $maxlifetime Maximum session life time * @return bool Success */ static function gc( $maxlifetime ) { return true; } /** * Shutdown function. See the comment inside ObjectCacheSessionHandler::install * for rationale. */ static function handleShutdown() { session_write_close(); } }