Skip Headers
Oracle® Fusion Middleware Idoc Script Reference Guide
11g Release 1 (11.1.1)

Part Number E10726-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to current chapter
Up
Go to next page
Next
View PDF

setCookie

Sets a cookie value in a browser.

Used to retain session information or information about anonymous users.

An expiration date can also be passed to make the cookie expire at a specified time.

Important:

Do not store secure data in a cookie. You should limit the use of cookies due to the risk of malicious users setting cookies on your site.

Type and Usage

Parameters

This function can take three parameters:

Example

The following example sets the cookie myCounter in the user's browser and increments the value when the user visits the page. The cookie will expire in one day.

<$myCounter=getCookie("myCounter")$>
<$if not myCounter$>
    <$myCounter=1$>
<$endif$>
Num times loaded: <$myCounter$>
<$setCookie("myCounter", myCounter+1, dateCurrent(1))$>

See Also