Вход Регистрация
Файл: adultscript-2.0.3-pro/files/libraries/framework/session.php
Строк: 54
<?php
defined
('_VALID') or die('Restricted Access!');
define('SESSION_USE_COOKIES'1);
define('SESSION_USE_ONLY_COOKIES'0);
class 
VSession
{
    protected 
$driver;
    protected 
$lifetime;
    protected 
$secret;
    protected 
$name;
    public function 
__construct()
    {
        
$cfg            VF::cfg('core.config');
        
$this->driver    $cfg['session_driver'];
        
$this->lifetime    intval($cfg['session_lifetime'])*60;
        
$this->secret    $cfg['secret'];
        
$this->name        $cfg['session_name'].'_'.md5($this->secret);
        
        
ini_set('session.name'$this->name);
        
ini_set('session.use_cookies'SESSION_USE_COOKIES);
        
ini_set('session.use_only_cookies'SESSION_USE_ONLY_COOKIES);
        
ini_set('session.gc_maxlifetime'$this->lifetime);
        
ini_set('session.save_path'TMP_DIR'/sessions');
        
ini_set('session.use_trans_sid'0);
        
ini_set('url_rewriter.tags''');
    }
    
    public function 
getDriver()
    {
        
VF::load('framework.session.'.$this->driver);
        
$driver_class 'VSession_Driver_'.$this->driver;
        return 
$session = new $driver_class();
    }
    
    public function 
register()
    {
        
session_set_save_handler(
            array(
$this'open'),
            array(
$this'close'),
            array(
$this'read'),
            array(
$this'write'),
            array(
$this'destroy'),
            array(
$this'gc')
        );
    }
    
    public function 
start()
    {
        
$this->register();
        
session_start();
    }
    
    public function 
regenerate()
    {
        
session_regenerate_id(TRUE);
    }
}
?>
Онлайн: 2
Реклама