<?php

final class Session {

    public $data = array();

    public function __construct($name='BSuite3') {
        session_name($name);
        session_start();
        if (!session_id()) {
            ini_set('session.use_cookies', 'On');
            ini_set('session.use_trans_sid', 'Off');

            //session_set_cookie_params(86400, '/');
        }
        $this->data = & $_SESSION;
    }

    public function hasPermission($method,$route) {
        return isset($this->data['permissions'][$route][$method])?true:false;
    }

}

?>