<xsql:set-cookie>

Sets the value of an HTTP Cookie, and optionally specifies the maximum age and domain of the cookie.

XSQL Syntax

<xsql:set-cookie
  name="string"
  [ domain="string" ]
  [ ignore-empty-value="boolean" ]
  [ max-age="integer" ]
  [ only-if-unset="boolean" ]
  [ path="string" ]
  [ value="string" ]
>
SQL
</xsql:set-cookie>

Examples

The following example sets the HTTP cookie to the value of the parameter named choice:

<xsql:set-cookie name="last_selection" value="{@choice}"/>

The following example sets the HTTP cookie to a value selected from the database:

<xsql:set-cookie name="shopping_cart_id">
  SELECT cartmgr.new_cart_id(UPPER('{@user}')) FROM dual
</xsql:set-cookie>

Description

Sets the value of an HTTP Cookie, and optionally specifies the maximum age and domain of the cookie. The value of the cookie can be set on the wizard's Value Selector page by either of the following:

Only the value attribute or the SQL statement can appear in the Set Cookie tag; they cannot be used together.

Attributes