CCookie::setDomain

The CCookie::setDomain function sets the Domain attribute of the cookie.

int setDomain(
chchar * domain // containing the value of the Domain attribute
);



Return Type

int
Upon successful completion, zero is returned. Otherwise, a value of non-zero is returned.


Parameters

domain
A string containing the value of the Domain attribute of the cookie.


Remarks

This function sets the Domain attribute of the cookie. The value of the Domain attribute specifies the domain for which the cookie is valid. If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.

The CCookie::getDomain function can be used to retrieve the Domain attribute of the cookie.


See Also

CCookie, CCookie::getDomain, CResponse::addCookie, CRequest::getCookies, CRequest::getCookie

Example