Request GetCookie, Response SetCookie Example

This example shows how to get a cookie value and how set a cookie value. The cookie value will be empty on the first request because no cookie has been set. After the first request, request.getcookie will return the value that was set by response.setcookie if the cookie has not yet expired.

Smartsite SXML CopyCode image Copy Code
{request.getcookie(mycookie)}
{response.setcookie(mycookie, 'Some value', datetime.getdate(2009, 6, 20, 14, 45, 00))}