Skip to content
Snippets Groups Projects
  • Jared Hancock's avatar
    908e0ad0
    Make API requests stateless · 908e0ad0
    Jared Hancock authored
    Disable DB session storage. This chews up database space and processing time
    for a request that will never resume the same session (given the current API
    model anyway).
    908e0ad0
    History
    Make API requests stateless
    Jared Hancock authored
    Disable DB session storage. This chews up database space and processing time
    for a request that will never resume the same session (given the current API
    model anyway).
api.inc.php 941 B
<?php
/*********************************************************************
    api.inc.php

    File included on every API page...handles common includes.

    Peter Rotich <peter@osticket.com>
    Copyright (c)  2006-2013 osTicket
    http://www.osticket.com

    Released under the GNU General Public License WITHOUT ANY WARRANTY.
    See LICENSE.TXT for details.

    vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/
file_exists('../main.inc.php') or die('System Error');

// Disable sessions for the API. API should be considered stateless and
// shouldn't chew up database records to store sessions
if (!function_exists('noop')) { function noop() {} }
session_set_save_handler('noop','noop','noop','noop','noop','noop');
define('DISABLE_SESSION', true);

require_once('../main.inc.php');
require_once(INCLUDE_DIR.'class.http.php');
require_once(INCLUDE_DIR.'class.api.php');

?>