Helma logo
helma.org » Home > Stories > res.setCookie()

res.setCookie()

Sets a cookie to be sent to the client machine.

Syntax
res.setCookie(nameString, valueString, daysNumber, pathString, domainString)

All arguments after nameString and valueString are optional.

daysNumber specifies the number of days until the cookie expires.
If set to 0, the cookie will be deleted immediately.
If the argument is not specified or set to a negative value, the cookie will be discarded is at the end of the browser session.

pathString specifies the path on which to set the cookie (defaults to /)

domainString specifies the domain on which to set the cookie (defaults to unset)

Example
res.setCookie("username", "michi");
res.setCookie("password", "strenggeheim", 10, "/mypath", ".mydomain.org");


... comment


Page last modified on 2005-09-14 09:40 by czv