Java HttpCookie getDiscard() 方法

2025年3月22日 | 阅读1分钟

HttpCookie 类的 getDiscard() 方法用于返回 cookie 的 discard 属性。

语法

参数

不适用。

返回

上述方法用于返回一个布尔值,表示 cookie 的 discard 属性。

示例 1

输出

Checks the discard attribute of the cookie : false

示例 2

输出

Checks the discard attribute of the cookie: true
下一主题getDomain() 方法