![]()
Cookie Manager
The CookieManager supports the HTTP State Management Mechanism (RFC 2109). If the CookieManager is not configured, all cookies are rejected.
To use the CookieManager, add the following to your application:
import ice.net.CookieManger; import ice.net.HttpURLConnection; CookieManager cookieManager = new CookieManager(); HttpURLConnection.setGlobalCookieManager(cookieManager);After the CookieManager is created, you can limit the cookie size, the number of cookies that are stored, and the maximum size of the stored cookies:
// sets the maximum size of a cookie to 2KB. cookieManager.setMaxCookieSize(2048); // sets the maximum number of cookies being stored to 100. cookieManager.setMaxNumberOfCookies(100); // sets the maximum size of all cookies together to 100KB. cookieManager.setMaxTotalCookieSize(102400);Two system properties can be set for the CookieManager: ice.net.cookieExpirationBufferEnabled and ice.net.persistPrivateCookies. For more information on these properties, see System Properties.
For more information on the cookie manager, see the API documentation for ice.net.CookieManager. For more information on cookies, see Step 7 - HTTP and Other Extra Modules of the tutorial.
|
Copyright 2005. ICEsoft Technologies, Inc. http://www.icesoft.com |