Ejemplo n.º 1
0
    session_set_cookie_params(0);
    session_name($app->get('config.session.name'));
    session_start();
}
/*
 * Set default time
 */
date_default_timezone_set($app->get('config.app.timezone'));
use WebSupportDK\PHPSecurity\Cookie;
use WebSupportDK\PHPSecurity\Session;
define('APP_LOCALE', $app->get('config.app.locale'));
define('APP_CHARSET', $app->get('config.app.charset'));
// Set default locale
Session::set('locale', APP_LOCALE);
// Set session locale
if (Cookie::exists('locale')) {
    $app->set('messages', require APP_LANG . Cookie::get('locale') . '/messages.php');
} else {
    $app->set('messages', require APP_LANG . Session::get('locale') . '/messages.php');
}
/*
 * Set View
 */
use WebSupportDK\PHPMvcFramework\View;
$app->set('View', View::load());
$app->get('View')->setTemplatePath(APP_VIEW);
$app->get('View')->setFeedbackFile(APP_VIEW . 'layouts/feedback');
/*
 * Set Cache
 */
use WebSupportDK\PHPFilesystem\Cache;
Ejemplo n.º 2
0
 public function logout()
 {
     if (Cookie::exists($this->cookieName)) {
         $this->db->delete($this->sessions, array(array('Token', '=', Cookie::get($this->sessionName))));
     }
     Session::delete($this->sessionName);
     Cookie::delete($this->cookieName);
 }