protected function setUp() { $this->sessionId = \ApplicationInsights\Channel\Contracts\Utils::returnGuid(); $this->sessionCreatedTime = time(); $this->sessionLastRenewedTime = time() - 10000; Utils::setSessionCookie($this->sessionId, $this->sessionCreatedTime, $this->sessionLastRenewedTime); }
/** * Initializes a new Current_User. */ function __construct() { if (array_key_exists('ai_user', $_COOKIE)) { $parts = explode('|', $_COOKIE['ai_user']); if (sizeof($parts) > 0) { $this->id = $parts[0]; } } if ($this->id == NULL) { $this->id = \ApplicationInsights\Channel\Contracts\Utils::returnGuid(); $_COOKIE['ai_user'] = $this->id; } }
/** * Creates session cookie for testing. */ public static function setSessionCookie($sessionId = NULL, $sessionCreatedDate = NULL, $lastRenewedDate = NULL) { $sessionId = $sessionId == NULL ? \ApplicationInsights\Channel\Contracts\Utils::returnGuid() : $sessionId; $sessionCreatedDate == NULL ? $sessionCreatedDate = time() : $sessionCreatedDate; $lastRenewedDate == NULL ? $lastRenewedDate = time() : $lastRenewedDate; $_COOKIE['ai_session'] = $sessionId . '|' . \ApplicationInsights\Channel\Contracts\Utils::returnISOStringForTime($sessionCreatedDate) . '|' . \ApplicationInsights\Channel\Contracts\Utils::returnISOStringForTime($lastRenewedDate); }
protected function setUp() { $this->userId = \ApplicationInsights\Channel\Contracts\Utils::returnGuid(); Utils::setUserCookie($this->userId); }