August 2002
Intermediate to advanced
688 pages
23h
English
<ora:addCookie>
The <ora:addCookie>
action sets response headers for creating or
deleting a cookie. It must be used
before the response is committed, for instance before a
<jsp:include> action with the
flush attribute set to true.
<ora:addCookie name="cookieName" value="cookieValue" [maxAge="ageInSeconds"] />
|
Attribute name |
Java type |
Dynamic value accepted |
Description |
|---|---|---|---|
name |
String |
EL expression |
The cookie name. |
value |
String |
EL expression |
The cookie value. |
maxAge |
String |
EL expression |
The number of seconds before the cookie expires. Default is -1, meaning that the cookie expires when the browser is closed. Use 0 to delete the cookie from the browser. |
<%--
Add a cookie named "userName", using the value from a
request parameter with the same name, that expires in
30 days
--%>
<ora:addCookie name="userName"
value="${param:username}"
maxAge="${30 * 24 * 60 * 60}"
/>
<%--
Delete a cookie named "userName"
--%>
<ora:addCookie name="userName"
value="ignored"
maxAge="0"
/>Read now
Unlock full access