Notes
An extended version of
SetCookie with more parameters available. You can set the path, domain, and expiry of the cookie.
Like web headers, cookies must be set before any output. Use this function prior to functions such as templateout, outln, webwrite, etc.
Parameters
path
Specifies the subset of URLs in a domain for which the cookie is valid. If a cookie has already passed domain matching, then the pathname component of the URL is compared with the path attribute. If there is a match, the cookie is considered valid. It is then sent along with the URL request. The path "/test" would match "/testing" and "/test/page.html". The path "/" is the most general path.
domain
When searching the cookie list for valid cookies, a comparison of the domain attributes of the cookie is made with the Internet domain name of the host from which the URL will be fetched. If there is a tail match, then the cookie will go through path matching to see if it should be sent. "Tail matching" means that domain attribute is matched against the tail of the fully qualified domain name of the host. A domain attribute of "acme.com" would match host names "anvil.acme.com" as well as "shipping.crate.acme.com".
Only hosts within the specified domain can set a cookie for a domain.
expires
The expires attribute specifies a valid life time of a cookie. Once expiration date is reached, the cookie will no longer be stored/accessed on the user's system.
Example
begin
SetCookieEx('foo', 'bar', '/some/path', 'www.server.net', 'Fri, 09 Sep 2005 12:00:00 GMT');
end.