'Creates the value for ``Set-Cookie`` HTTP header.
:param bool delete:
If ``True`` the cookie value will be ``deleted`` and the
Expires value will be ``Thu, 01-Jan-1970 00:00:01 GMT``.'

def create_cookie(self, delete=None):

    value = ('deleted' if delete else self._serialize(self.data))
    split_url = parse.urlsplit(self.adapter.url)
    domain = split_url.netloc.split(':')[0]
    if ('.' not in domain):
        template = '{name}={value};    Path={path};    HttpOnly{secure}{expires}'
    else:
        template = '{name}={value};    Domain={domain};    Path={path};    HttpOnly{secure}{expires}'
    return template.format(name=self.name, value=value, domain=domain, path=split_url.path, secure=(';    Secure' if self.secure else ''), expires=(';    Expires=Thu,    01-Jan-1970    00:00:01    GMT' if delete else ''))
