public function addTag($tag)
{
if ($this->started !== true) {
throw new Exception\SessionNotStartedException('Tried to tag a session which has not been started yet.', 1355143533);
}
if (!$this->metaDataCache->isValidTag($tag)) {
throw new \InvalidArgumentException(sprintf('The tag used for tagging session %s contained invalid characters. Make sure it matches this regular expression: "%s"', $this->sessionIdentifier, FrontendInterface::PATTERN_TAG));
}
if (!in_array($tag, $this->tags)) {
$this->tags[] = $tag;
}
}