/usr/share/doc/libservlet3.0-java/api/javax/servlet/http/Cookie.html is in libservlet3.0-java-doc 7.0.56-3+deb8u11.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.7.0_131) on Tue Jun 20 18:23:54 UTC 2017 -->
<title>Cookie (Tomcat API Documentation)</title>
<meta name="date" content="2017-06-20">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Cookie (Tomcat API Documentation)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../javax/servlet/http/HttpServlet.html" title="class in javax.servlet.http"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/servlet/http/Cookie.html" target="_top">Frames</a></li>
<li><a href="Cookie.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">javax.servlet.http</div>
<h2 title="Class Cookie" class="title">Class Cookie</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>javax.servlet.http.Cookie</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable, java.lang.Cloneable</dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">Cookie</span>
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable</pre>
<div class="block">Creates a cookie, a small amount of information sent by a servlet to a Web
browser, saved by the browser, and later sent back to the server. A cookie's
value can uniquely identify a client, so cookies are commonly used for
session management.
<p>
A cookie has a name, a single value, and optional attributes such as a
comment, path and domain qualifiers, a maximum age, and a version number.
Some Web browsers have bugs in how they handle the optional attributes, so
use them sparingly to improve the interoperability of your servlets.
<p>
The servlet sends cookies to the browser by using the
<a href="../../../javax/servlet/http/HttpServletResponse.html#addCookie(javax.servlet.http.Cookie)"><code>HttpServletResponse.addCookie(javax.servlet.http.Cookie)</code></a> method, which adds fields to HTTP
response headers to send cookies to the browser, one at a time. The browser
is expected to support 20 cookies for each Web server, 300 cookies total, and
may limit cookie size to 4 KB each.
<p>
The browser returns cookies to the servlet by adding fields to HTTP request
headers. Cookies can be retrieved from a request by using the
<a href="../../../javax/servlet/http/HttpServletRequest.html#getCookies()"><code>HttpServletRequest.getCookies()</code></a> method. Several cookies might have the
same name but different path attributes.
<p>
Cookies affect the caching of the Web pages that use them. HTTP 1.0 does not
cache pages that use cookies created with this class. This class does not
support the cache control defined with HTTP 1.1.
<p>
This class supports both the Version 0 (by Netscape) and Version 1 (by RFC
2109) cookie specifications. By default, cookies are created using Version 0
to ensure the best interoperability.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../serialized-form.html#javax.servlet.http.Cookie">Serialized Form</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../javax/servlet/http/Cookie.html#Cookie(java.lang.String,%20java.lang.String)">Cookie</a></strong>(java.lang.String name,
java.lang.String value)</code>
<div class="block">Constructs a cookie with a specified name and value.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.Object</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#clone()">clone</a></strong>()</code>
<div class="block">Overrides the standard <code>java.lang.Object.clone</code> method to
return a copy of this cookie.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#getComment()">getComment</a></strong>()</code>
<div class="block">Returns the comment describing the purpose of this cookie, or
<code>null</code> if the cookie has no comment.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#getDomain()">getDomain</a></strong>()</code>
<div class="block">Returns the domain name set for this cookie.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#getMaxAge()">getMaxAge</a></strong>()</code>
<div class="block">Returns the maximum age of the cookie, specified in seconds, By default,
<code>-1</code> indicating the cookie will persist until browser
shutdown.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#getName()">getName</a></strong>()</code>
<div class="block">Returns the name of the cookie.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#getPath()">getPath</a></strong>()</code>
<div class="block">Returns the path on the server to which the browser returns this cookie.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#getSecure()">getSecure</a></strong>()</code>
<div class="block">Returns <code>true</code> if the browser is sending cookies only over a
secure protocol, or <code>false</code> if the browser can send cookies
using any protocol.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#getValue()">getValue</a></strong>()</code>
<div class="block">Returns the value of the cookie.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#getVersion()">getVersion</a></strong>()</code>
<div class="block">Returns the version of the protocol this cookie complies with.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#isHttpOnly()">isHttpOnly</a></strong>()</code>
<div class="block">Gets the flag that controls if this cookie will be hidden from scripts on
the client side.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#setComment(java.lang.String)">setComment</a></strong>(java.lang.String purpose)</code>
<div class="block">Specifies a comment that describes a cookie's purpose.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#setDomain(java.lang.String)">setDomain</a></strong>(java.lang.String pattern)</code>
<div class="block">Specifies the domain within which this cookie should be presented.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#setHttpOnly(boolean)">setHttpOnly</a></strong>(boolean httpOnly)</code>
<div class="block">Sets the flag that controls if this cookie will be hidden from scripts on
the client side.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#setMaxAge(int)">setMaxAge</a></strong>(int expiry)</code>
<div class="block">Sets the maximum age of the cookie in seconds.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#setPath(java.lang.String)">setPath</a></strong>(java.lang.String uri)</code>
<div class="block">Specifies a path for the cookie to which the client should return the
cookie.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#setSecure(boolean)">setSecure</a></strong>(boolean flag)</code>
<div class="block">Indicates to the browser whether the cookie should only be sent using a
secure protocol, such as HTTPS or SSL.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#setValue(java.lang.String)">setValue</a></strong>(java.lang.String newValue)</code>
<div class="block">Assigns a new value to a cookie after the cookie is created.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/servlet/http/Cookie.html#setVersion(int)">setVersion</a></strong>(int v)</code>
<div class="block">Sets the version of the cookie protocol this cookie complies with.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="Cookie(java.lang.String, java.lang.String)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Cookie</h4>
<pre>public Cookie(java.lang.String name,
java.lang.String value)</pre>
<div class="block">Constructs a cookie with a specified name and value.
<p>
The name must conform to RFC 2109. That means it can contain only ASCII
alphanumeric characters and cannot contain commas, semicolons, or white
space or begin with a $ character. The cookie's name cannot be changed
after creation.
<p>
The value can be anything the server chooses to send. Its value is
probably of interest only to the server. The cookie's value can be
changed after creation with the <code>setValue</code> method.
<p>
By default, cookies are created according to the Netscape cookie
specification. The version can be changed with the
<code>setVersion</code> method.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - a <code>String</code> specifying the name of the cookie</dd><dd><code>value</code> - a <code>String</code> specifying the value of the cookie</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if the cookie name contains illegal characters (for example,
a comma, space, or semicolon) or it is one of the tokens
reserved for use by the cookie protocol</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/servlet/http/Cookie.html#setValue(java.lang.String)"><code>setValue(java.lang.String)</code></a>,
<a href="../../../javax/servlet/http/Cookie.html#setVersion(int)"><code>setVersion(int)</code></a></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="setComment(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setComment</h4>
<pre>public void setComment(java.lang.String purpose)</pre>
<div class="block">Specifies a comment that describes a cookie's purpose. The comment is
useful if the browser presents the cookie to the user. Comments are not
supported by Netscape Version 0 cookies.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>purpose</code> - a <code>String</code> specifying the comment to display to the
user</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/servlet/http/Cookie.html#getComment()"><code>getComment()</code></a></dd></dl>
</li>
</ul>
<a name="getComment()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getComment</h4>
<pre>public java.lang.String getComment()</pre>
<div class="block">Returns the comment describing the purpose of this cookie, or
<code>null</code> if the cookie has no comment.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a <code>String</code> containing the comment, or
<code>null</code> if none</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/servlet/http/Cookie.html#setComment(java.lang.String)"><code>setComment(java.lang.String)</code></a></dd></dl>
</li>
</ul>
<a name="setDomain(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setDomain</h4>
<pre>public void setDomain(java.lang.String pattern)</pre>
<div class="block">Specifies the domain within which this cookie should be presented.
<p>
The form of the domain name is specified by RFC 2109. A domain name
begins with a dot (<code>.foo.com</code>) and means that the cookie is
visible to servers in a specified Domain Name System (DNS) zone (for
example, <code>www.foo.com</code>, but not <code>a.b.foo.com</code>). By
default, cookies are only returned to the server that sent them.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pattern</code> - a <code>String</code> containing the domain name within which
this cookie is visible; form is according to RFC 2109</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/servlet/http/Cookie.html#getDomain()"><code>getDomain()</code></a></dd></dl>
</li>
</ul>
<a name="getDomain()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDomain</h4>
<pre>public java.lang.String getDomain()</pre>
<div class="block">Returns the domain name set for this cookie. The form of the domain name
is set by RFC 2109.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a <code>String</code> containing the domain name</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/servlet/http/Cookie.html#setDomain(java.lang.String)"><code>setDomain(java.lang.String)</code></a></dd></dl>
</li>
</ul>
<a name="setMaxAge(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMaxAge</h4>
<pre>public void setMaxAge(int expiry)</pre>
<div class="block">Sets the maximum age of the cookie in seconds.
<p>
A positive value indicates that the cookie will expire after that many
seconds have passed. Note that the value is the <i>maximum</i> age when
the cookie will expire, not the cookie's current age.
<p>
A negative value means that the cookie is not stored persistently and
will be deleted when the Web browser exits. A zero value causes the
cookie to be deleted.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>expiry</code> - an integer specifying the maximum age of the cookie in
seconds; if negative, means the cookie is not stored; if zero,
deletes the cookie</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/servlet/http/Cookie.html#getMaxAge()"><code>getMaxAge()</code></a></dd></dl>
</li>
</ul>
<a name="getMaxAge()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxAge</h4>
<pre>public int getMaxAge()</pre>
<div class="block">Returns the maximum age of the cookie, specified in seconds, By default,
<code>-1</code> indicating the cookie will persist until browser
shutdown.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>an integer specifying the maximum age of the cookie in seconds; if
negative, means the cookie persists until browser shutdown</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/servlet/http/Cookie.html#setMaxAge(int)"><code>setMaxAge(int)</code></a></dd></dl>
</li>
</ul>
<a name="setPath(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPath</h4>
<pre>public void setPath(java.lang.String uri)</pre>
<div class="block">Specifies a path for the cookie to which the client should return the
cookie.
<p>
The cookie is visible to all the pages in the directory you specify, and
all the pages in that directory's subdirectories. A cookie's path must
include the servlet that set the cookie, for example, <i>/catalog</i>,
which makes the cookie visible to all directories on the server under
<i>/catalog</i>.
<p>
Consult RFC 2109 (available on the Internet) for more information on
setting path names for cookies.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>uri</code> - a <code>String</code> specifying a path</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/servlet/http/Cookie.html#getPath()"><code>getPath()</code></a></dd></dl>
</li>
</ul>
<a name="getPath()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPath</h4>
<pre>public java.lang.String getPath()</pre>
<div class="block">Returns the path on the server to which the browser returns this cookie.
The cookie is visible to all subpaths on the server.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a <code>String</code> specifying a path that contains a servlet
name, for example, <i>/catalog</i></dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/servlet/http/Cookie.html#setPath(java.lang.String)"><code>setPath(java.lang.String)</code></a></dd></dl>
</li>
</ul>
<a name="setSecure(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSecure</h4>
<pre>public void setSecure(boolean flag)</pre>
<div class="block">Indicates to the browser whether the cookie should only be sent using a
secure protocol, such as HTTPS or SSL.
<p>
The default value is <code>false</code>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>flag</code> - if <code>true</code>, sends the cookie from the browser to the
server only when using a secure protocol; if
<code>false</code>, sent on any protocol</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/servlet/http/Cookie.html#getSecure()"><code>getSecure()</code></a></dd></dl>
</li>
</ul>
<a name="getSecure()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSecure</h4>
<pre>public boolean getSecure()</pre>
<div class="block">Returns <code>true</code> if the browser is sending cookies only over a
secure protocol, or <code>false</code> if the browser can send cookies
using any protocol.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the browser uses a secure protocol;
otherwise, <code>true</code></dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/servlet/http/Cookie.html#setSecure(boolean)"><code>setSecure(boolean)</code></a></dd></dl>
</li>
</ul>
<a name="getName()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getName</h4>
<pre>public java.lang.String getName()</pre>
<div class="block">Returns the name of the cookie. The name cannot be changed after
creation.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a <code>String</code> specifying the cookie's name</dd></dl>
</li>
</ul>
<a name="setValue(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setValue</h4>
<pre>public void setValue(java.lang.String newValue)</pre>
<div class="block">Assigns a new value to a cookie after the cookie is created. If you use a
binary value, you may want to use BASE64 encoding.
<p>
With Version 0 cookies, values should not contain white space, brackets,
parentheses, equals signs, commas, double quotes, slashes, question
marks, at signs, colons, and semicolons. Empty values may not behave the
same way on all browsers.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>newValue</code> - a <code>String</code> specifying the new value</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/servlet/http/Cookie.html#getValue()"><code>getValue()</code></a>,
<a href="../../../javax/servlet/http/Cookie.html" title="class in javax.servlet.http"><code>Cookie</code></a></dd></dl>
</li>
</ul>
<a name="getValue()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValue</h4>
<pre>public java.lang.String getValue()</pre>
<div class="block">Returns the value of the cookie.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a <code>String</code> containing the cookie's present value</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/servlet/http/Cookie.html#setValue(java.lang.String)"><code>setValue(java.lang.String)</code></a>,
<a href="../../../javax/servlet/http/Cookie.html" title="class in javax.servlet.http"><code>Cookie</code></a></dd></dl>
</li>
</ul>
<a name="getVersion()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getVersion</h4>
<pre>public int getVersion()</pre>
<div class="block">Returns the version of the protocol this cookie complies with. Version 1
complies with RFC 2109, and version 0 complies with the original cookie
specification drafted by Netscape. Cookies provided by a browser use and
identify the browser's cookie version.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>0 if the cookie complies with the original Netscape specification;
1 if the cookie complies with RFC 2109</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/servlet/http/Cookie.html#setVersion(int)"><code>setVersion(int)</code></a></dd></dl>
</li>
</ul>
<a name="setVersion(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setVersion</h4>
<pre>public void setVersion(int v)</pre>
<div class="block">Sets the version of the cookie protocol this cookie complies with.
Version 0 complies with the original Netscape cookie specification.
Version 1 complies with RFC 2109.
<p>
Since RFC 2109 is still somewhat new, consider version 1 as experimental;
do not use it yet on production sites.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>v</code> - 0 if the cookie should comply with the original Netscape
specification; 1 if the cookie should comply with RFC 2109</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/servlet/http/Cookie.html#getVersion()"><code>getVersion()</code></a></dd></dl>
</li>
</ul>
<a name="clone()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clone</h4>
<pre>public java.lang.Object clone()</pre>
<div class="block">Overrides the standard <code>java.lang.Object.clone</code> method to
return a copy of this cookie.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code>clone</code> in class <code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
<a name="setHttpOnly(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setHttpOnly</h4>
<pre>public void setHttpOnly(boolean httpOnly)</pre>
<div class="block">Sets the flag that controls if this cookie will be hidden from scripts on
the client side.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>httpOnly</code> - The new value of the flag</dd><dt><span class="strong">Since:</span></dt>
<dd>Servlet 3.0</dd></dl>
</li>
</ul>
<a name="isHttpOnly()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>isHttpOnly</h4>
<pre>public boolean isHttpOnly()</pre>
<div class="block">Gets the flag that controls if this cookie will be hidden from scripts on
the client side.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the cookie is hidden from scripts, else
<code>false</code></dd><dt><span class="strong">Since:</span></dt>
<dd>Servlet 3.0</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../javax/servlet/http/HttpServlet.html" title="class in javax.servlet.http"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/servlet/http/Cookie.html" target="_top">Frames</a></li>
<li><a href="Cookie.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.</small></p>
</body>
</html>
|