예제 #1
0
파일: session.php 프로젝트: raj47i/PHP.Fx
 public static function Get()
 {
     if (is_null(self::$self)) {
         $class = __CLASS__;
         self::$self = new $class();
     }
     return self::$self;
 }
예제 #2
0
 public function __construct($mem)
 {
     self::$mem = $mem;
     self::$maxtime = ini_get('session.gc_maxlifetime');
     session_module_name('user');
     //session文件保存方式,这个是必须的!除非在Php.ini文件中设置了
     session_set_save_handler(array(__CLASS__, 'open'), array(__CLASS__, 'close'), array(__CLASS__, 'read'), array(__CLASS__, 'write'), array(__CLASS__, 'destroy'), array(__CLASS__, 'gc'));
     session_start();
     //这也是必须的,打开session,必须在session_set_save_handler后面执行
 }
예제 #3
0
 private static function _create_session()
 {
     self::$_system_session = SystemSession::add($_SESSION);
     self::$_data_hash = md5(serialize($_SESSION));
     setcookie(Config::get('COOKIE_NAME'), self::$_system_session->getSessionId(), time() + 31536000, '/');
 }