当前位置: 首页>>代码示例>>PHP>>正文


PHP tao_helpers_Uri::isValidAsCookieDomain方法代码示例

本文整理汇总了PHP中tao_helpers_Uri::isValidAsCookieDomain方法的典型用法代码示例。如果您正苦于以下问题:PHP tao_helpers_Uri::isValidAsCookieDomain方法的具体用法?PHP tao_helpers_Uri::isValidAsCookieDomain怎么用?PHP tao_helpers_Uri::isValidAsCookieDomain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tao_helpers_Uri的用法示例。


在下文中一共展示了tao_helpers_Uri::isValidAsCookieDomain方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testIsValidAsCookieDomain

 public function testIsValidAsCookieDomain()
 {
     $this->assertFalse(tao_helpers_Uri::isValidAsCookieDomain('http://mytaoplatform'));
     $this->assertFalse(tao_helpers_Uri::isValidAsCookieDomain('http://my-tao-platform'));
     $this->assertFalse(tao_helpers_Uri::isValidAsCookieDomain('mytaoplatform'));
     $this->assertFalse(tao_helpers_Uri::isValidAsCookieDomain('mytaoplatform/items/'));
     $this->assertFalse(tao_helpers_Uri::isValidAsCookieDomain(''));
     $this->assertTrue(tao_helpers_Uri::isValidAsCookieDomain('http://mytaoplatform.com'));
     $this->assertTrue(tao_helpers_Uri::isValidAsCookieDomain('http://my-tao-platform.ru'));
     $this->assertTrue(tao_helpers_Uri::isValidAsCookieDomain('http://www.mytaoplatform.com'));
     $this->assertTrue(tao_helpers_Uri::isValidAsCookieDomain('http://www.-my-tao-platform.ru'));
     $this->assertTrue(tao_helpers_Uri::isValidAsCookieDomain('http://my.taoplatform.com'));
     $this->assertTrue(tao_helpers_Uri::isValidAsCookieDomain('http://my.tao.platform.qc.ca'));
     $this->assertTrue(tao_helpers_Uri::isValidAsCookieDomain('http://my.TAO.plAtfOrm.qc.cA'));
     $this->assertFalse(tao_helpers_Uri::isValidAsCookieDomain('http://.my.tao.platform.qc.ca'));
 }
开发者ID:nagyist,项目名称:tao-core,代码行数:16,代码来源:UriHelperTest.php

示例2: session

 /**
  * Start the session
  */
 protected function session()
 {
     if (tao_helpers_Context::check('APP_MODE')) {
         // Set a specific ID to the session.
         $request = new Request();
         if ($request->hasParameter('session_id')) {
             session_id($request->getParameter('session_id'));
         }
     }
     // set the session cookie to HTTP only.
     $this->configureSessionHandler();
     $sessionParams = session_get_cookie_params();
     $cookieDomain = true == tao_helpers_Uri::isValidAsCookieDomain(ROOT_URL) ? tao_helpers_Uri::getDomain(ROOT_URL) : $sessionParams['domain'];
     session_set_cookie_params($sessionParams['lifetime'], tao_helpers_Uri::getPath(ROOT_URL), $cookieDomain, $sessionParams['secure'], TRUE);
     session_name(GENERIS_SESSION_NAME);
     if (isset($_COOKIE[GENERIS_SESSION_NAME])) {
         // Resume the session
         session_start();
         //cookie keep alive, if lifetime is not 0
         if ($sessionParams['lifetime'] !== 0) {
             $expiryTime = $sessionParams['lifetime'] + time();
             setcookie(session_name(), session_id(), $expiryTime, tao_helpers_Uri::getPath(ROOT_URL), $cookieDomain, $sessionParams['secure'], true);
         }
     }
 }
开发者ID:swapnilaptara,项目名称:tao-aptara-assess,代码行数:28,代码来源:class.Bootstrap.php


注:本文中的tao_helpers_Uri::isValidAsCookieDomain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。