Beispiel #1
0
 function __construct()
 {
     if (!self::$iniciada) {
         session_start();
         $this->_control();
     }
     self::$iniciada = true;
 }
Beispiel #2
0
 function __construct($nombre = NULL)
 {
     if ($nombre != NULL) {
         session_name($nombre);
     }
     if (!self::$iniciada) {
         session_start();
     }
     self::$iniciada = true;
 }
Beispiel #3
0
 function __construct($nombre = null)
 {
     if (!self::$iniciada) {
         if ($nombre != null) {
             session_name($nombre);
         }
         session_start();
         $this->_control();
         self::$iniciada = true;
     }
 }
Beispiel #4
0
 function __construct($nombre = "null")
 {
     if (!self::$iniciada) {
         //le pongo el nombre de sesión para poder distinguir sesiones
         //de distinto tipo
         if ($nombre != null) {
             session_name($nombre);
         }
         session_start();
         $this->_control();
         self::$iniciada = true;
     }
 }
Beispiel #5
0
 function __construct()
 {
     if (!self::$iniciada) {
         session_start();
         //            $this->_control();
         $ip = $this->get("_ip");
         $cliente = $this->get("_cliente");
         if ($ip == null && $cliente == null) {
             $this->set("_ip", Server::getClientAddres());
             $this->set("_cliente", Server::getUserAgent());
         } else {
             if ($ip !== Server::getClientAddres() || $cliente !== Server::getUserAgent()) {
                 $this->destroy();
                 //$this->truested = false;  // Esto lo podemos usar como alternativa (lo veremos más adelante)
             }
         }
     }
     self::$iniciada = true;
 }
Beispiel #6
0
 function __construct($nombre = NULL)
 {
     if ($nombre != NULL) {
         session_name($nombre);
     }
     if (!self::$iniciada) {
         session_start();
         $ip = $this->get('_ip');
         $cliente = $this->get('_cliente');
         if ($ip == null && $cliente == null) {
             $this->set('_ip', Server::getClientAddress());
             $this->set('_cliente', Server::getUserAgent());
         } else {
             if ($ip !== Server::getClientAddress() || $cliente !== Server::getUserAgent()) {
                 session_destroy();
                 //$this->trusted=false;
             }
         }
     }
     self::$iniciada = true;
 }