Esempio n. 1
0
 /**
  * {@inheritDoc}
  */
 public function setCookieDomain($cookieDomain)
 {
     $cookieDomain = (string) $cookieDomain;
     if (empty($cookieDomain)) {
         $this->cookieDomain = '';
         $this->setStorageOption('cookie_domain', '');
     } else {
         $subdomains = false;
         if ('.' === $cookieDomain[0]) {
             $subdomains = true;
             $cookieDomain = ltrim($cookieDomain, '.');
         }
         parent::setCookieDomain($cookieDomain);
         if ($subdomains) {
             $this->setStorageOption('cookie_domain', $this->cookieDomain = '.' . $this->cookieDomain);
         }
     }
     return $this;
 }
Esempio n. 2
0
 public function testSettingInvalidCookieDomainRaisesException2()
 {
     $this->setExpectedException('Zend\\Session\\Exception\\InvalidArgumentException', 'does not match the expected structure for a DNS hostname');
     $this->config->setCookieDomain('D:\\WINDOWS\\System32\\drivers\\etc\\hosts');
 }