CCookie::setPath

The CCookie::setPath function sets the Path attribute of the cookie.

int setPath(
chchar * path // specifying a path
);



Return Type

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


Parameters

path
A string specifying a path.



Remarks

This function sets the path on the server to which browser returns the cookie. The cookie is visible to all the pages in the directory you specify, and all the pages in that directory's subdirectories. Consult RFC 2109 for more information on setting path names for cookies.

The CCookie::getPath function can be used to retrieve the Path attribute of the cookie.


See Also

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

Example