private function doLogin() { $val = array(); foreach ($this->credentials[0] as $name => $value) { $val[] = $name . ':' . $value; } $val = implode(';', $val); $val = Cryptography::encode($val); Session::set('fwLGN', $val); }
public static function generate($length = 64) { $seed = time() . $_SERVER['REMOTE_ADDR'] . openssl_random_pseudo_bytes($length); $seed = Cryptography::encode($seed, 'base64'); return substr($seed, 0, $length); }