/**
  * Creates the HMAC for the cookie.
  *
  * The HMAC is used to ensure the cookie cannot be tampered or replayed.
  *
  * @param string $userGID the user GID
  * @param string $data the serialized data
  * @param int $expires the expiration date
  * @param string $key the key generated by <code>createKey()</code>
  * @return string the HMAC
  */
 private function createHMAC($userGID, $data, $expires, $key)
 {
     return $this->hmacFunction->calculateHMAC($userGID . $expires . $data . $this->sessionIdentifier, $key);
 }