Home > Contents > Index >
Expanded TOC   |    Accordion TOC   |    Annotated TOC   |    Index

 

ICS.SetCookie

Sets a cookie on the client.

Syntax

Parameters

name
The name of the cookie to set.

value
The value to set the cookie to. Setting the value to null removes the cookie.

timeout
The timeout period for the cookie on the client, in seconds.

url
Valid URL. This value restricts the sending of the cookie from the client to this URL only. Defaults to "/" if omitted.

domain
Valid domain name. This value restricts the sending of the cookie from the client to addresses in this domain only.

bSecure
Indicates whether security is set on this cookie.

Description

The SetCookie method sets a cookie on the client.

SetCookie must appear before anything that streams back data on the page or the cookie will not be set. This is an HTTP requirement.

To remove a cookie, set the cookie value to null.

Returns

Returns true on success, false on failure.

Example

 

  Home > Contents > Index >

Oracle JAVA Reference
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.