DB\Jig\Session::__construct PHP Method

__construct() public method

Instantiate class
public __construct ( Jig $db, $file = 'sessions', $onsuspect = NULL, $key = NULL )
$db DB\Jig \DB\Jig
$file string
$onsuspect callback
$key string
    function __construct(\DB\Jig $db, $file = 'sessions', $onsuspect = NULL, $key = NULL)
    {
        parent::__construct($db, $file);
        $this->onsuspect = $onsuspect;
        session_set_save_handler([$this, 'open'], [$this, 'close'], [$this, 'read'], [$this, 'write'], [$this, 'destroy'], [$this, 'cleanup']);
        register_shutdown_function('session_commit');
        $fw = \Base::instance();
        $headers = $fw->get('HEADERS');
        $this->_csrf = $fw->get('SEED') . '.' . $fw->hash(mt_rand());
        if ($key) {
            $fw->set($key, $this->_csrf);
        }
        $this->_agent = isset($headers['User-Agent']) ? $headers['User-Agent'] : '';
        $this->_ip = $fw->get('IP');
    }