private function _control() { $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()) { $this->destroy(); } } }
private function _control() { $ip = $this->get("_IP"); $client = $this->get("_CLIENT"); if ($ip === null && $client === null) { $this->set("_IP", Server::getClientAddress()); $this->set("_CLIENT", Server::getUserAgent()); } else { if ($ip !== Server::getClientAddress() || $client !== Server::getUserAgent()) { $this->destroy(); } } }
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; }