<xsql:set-cookie>
Sets the value of an HTTP Cookie, and optionally specifies the maximum age
and domain of the cookie.
<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>
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>
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:
- Clicking the String button and specifying the
optional value attribute.
- Clicking the SQL button and including a SQL
statement as the element content. If the SQL statement is provided, the value
of the first column of the first row retrieved is used as the cookie value.
Only the value attribute or the SQL statement can appear in the Set
Cookie tag; they cannot be used together.
- name(Required, String value) Name of
the HTTP Cookie whose value you want to set.
- domain(Optional, String value) Domain
in which the cookie value is valid and readable. If the domain is not set
explicitly, then it defaults to the full domain of the document creating the
cookie.
- ignore-empty-value(Optional, Boolean
value) Indicates whether the cookie assignment should be ignored if the value
to which it is being assigned is an empty string. Valid values are yes
and no. Default value is no.
- max-age(Optional, Integer value) Sets
the maximum age of the cookie in seconds. Default is to set the cookie to
expire when users current browser session terminates.
- only-if-unset(Optional, Boolean value)
Indicates whether the cookie assignment should only occur when the cookie
currently does not exists. Valid values are yes and no.
Default value is no.
- path(Optional, String value) Relative
URL path within the domain in which the cookie value is valid and readable.
If the path is not set explicitly, then it defaults to the URL path of the
document creating the cookie.
- value(Optional, String value) Value to
assign to the cookie. Enter this value by clicking the String
button in the wizard's Value Selector page and entering a value in the editable
field.