The CCookie::setMaxAge function sets the maximum age of the cookie.
int maxAge // specifying the maximum age of the cookie in seconds
Upon successful completion, zero is returned. Otherwise, a value of non-zero is returned.
An integer specifying the maximum age of the cookie in seconds.
This function sets the maximum age of the cookie. The value of the maximum age is the lifetime of the cookie in seconds. It is a decimal non-negative integer. To handle cached cookies correctly, a client SHOULD calculate the age of the cookie according to the age calculation rules in the HTTP/1.1 specification [RFC2616]. When the age is greater than seconds of maximum age, the client SHOULD discard the cookie. A value of zero means the cookie SHOULD be discarded immediately.
The CCookie::getMaxAge function can be used to retrieve the maximum age of the cookie.
CCookie, CCookie::getMaxAge, CResponse::addCookie, CRequest::getCookies, CRequest::getCookie