Home > Contents > Index >
Expanded TOC | Accordion TOC | Annotated TOC | Index
ICS.SetCookie
Sets a cookie on the client.
Syntax
public boolean SetCookie(String name, String value, int timeout, String url, String domain, boolean bSecure)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
ics.ClearErrno(); success = ics.SetCookie("acookie", "sweet", 100, "/", "/" , false ); int errnum = ics.GetErrno
(); if (success) ics.SetSSVar ("var4" , cs.GetSSVar
("acookie")); else ics.SetSSVar ("var4" , "failed");
Home > Contents > Index > Oracle JAVA Reference
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.