blob: 51820129a3f87400878726bf2b9a80907b539ca1 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>SessionCookieConfig</title>
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../script.js"></script>
<link rel="shortcut icon" href="/img/jakarta-favicon.ico">
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SessionCookieConfig";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":38,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":38,"i11":6,"i12":6,"i13":6,"i14":6,"i15":6,"i16":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<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><a href="../../jakarta/servlet/ServletSecurityElement.html" title="class in jakarta.servlet"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../jakarta/servlet/SessionTrackingMode.html" title="enum in jakarta.servlet"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?jakarta/servlet/SessionCookieConfig.html" target="_top">Frames</a></li>
<li><a href="SessionCookieConfig.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</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">jakarta.servlet</div>
<h2 title="Interface SessionCookieConfig" class="title">Interface SessionCookieConfig</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public interface <span class="typeNameLabel">SessionCookieConfig</span></pre>
<div class="block">Class that may be used to configure various properties of cookies used for session tracking purposes.
<p>
An instance of this class is acquired by a call to <a href="../../jakarta/servlet/ServletContext.html#getSessionCookieConfig--"><code>ServletContext.getSessionCookieConfig()</code></a>.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>Servlet 3.0</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/SessionCookieConfig.html#getAttribute-java.lang.String-">getAttribute</a></span>(java.lang.String&nbsp;name)</code>
<div class="block">Obtain the value for a given session cookie attribute.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>java.util.Map&lt;java.lang.String,java.lang.String&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/SessionCookieConfig.html#getAttributes--">getAttributes</a></span>()</code>
<div class="block">Obtain the Map (keys are case insensitive) of all attributes and values, including those set via the attribute
specific setters, (excluding version) for this <tt>SessionCookieConfig</tt>.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/SessionCookieConfig.html#getComment--">getComment</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">This is no longer required with RFC 6265</span></div>
</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/SessionCookieConfig.html#getDomain--">getDomain</a></span>()</code>
<div class="block">Gets the domain name that will be assigned to any session tracking cookies created on behalf of the application
represented by the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/SessionCookieConfig.html#getMaxAge--">getMaxAge</a></span>()</code>
<div class="block">Gets the lifetime (in seconds) of the session tracking cookies created on behalf of the application represented by
the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/SessionCookieConfig.html#getName--">getName</a></span>()</code>
<div class="block">Gets the name that will be assigned to any session tracking cookies created on behalf of the application represented
by the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/SessionCookieConfig.html#getPath--">getPath</a></span>()</code>
<div class="block">Gets the path that will be assigned to any session tracking cookies created on behalf of the application represented
by the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/SessionCookieConfig.html#isHttpOnly--">isHttpOnly</a></span>()</code>
<div class="block">Checks if the session tracking cookies created on behalf of the application represented by the
<tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired will be marked as <i>HttpOnly</i>.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/SessionCookieConfig.html#isSecure--">isSecure</a></span>()</code>
<div class="block">Checks if the session tracking cookies created on behalf of the application represented by the
<tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired will be marked as <i>secure</i>
even if the request that initiated the corresponding session is using plain HTTP instead of HTTPS.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/SessionCookieConfig.html#setAttribute-java.lang.String-java.lang.String-">setAttribute</a></span>(java.lang.String&nbsp;name,
java.lang.String&nbsp;value)</code>
<div class="block">Sets the value for the given session cookie attribute.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/SessionCookieConfig.html#setComment-java.lang.String-">setComment</a></span>(java.lang.String&nbsp;comment)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">This is no longer required with RFC 6265</span></div>
</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/SessionCookieConfig.html#setDomain-java.lang.String-">setDomain</a></span>(java.lang.String&nbsp;domain)</code>
<div class="block">Sets the domain name that will be assigned to any session tracking cookies created on behalf of the application
represented by the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/SessionCookieConfig.html#setHttpOnly-boolean-">setHttpOnly</a></span>(boolean&nbsp;httpOnly)</code>
<div class="block">Marks or unmarks the session tracking cookies created on behalf of the application represented by the
<tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired as <i>HttpOnly</i>.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/SessionCookieConfig.html#setMaxAge-int-">setMaxAge</a></span>(int&nbsp;maxAge)</code>
<div class="block">Sets the lifetime (in seconds) for the session tracking cookies created on behalf of the application represented by
the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/SessionCookieConfig.html#setName-java.lang.String-">setName</a></span>(java.lang.String&nbsp;name)</code>
<div class="block">Sets the name that will be assigned to any session tracking cookies created on behalf of the application represented
by the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/SessionCookieConfig.html#setPath-java.lang.String-">setPath</a></span>(java.lang.String&nbsp;path)</code>
<div class="block">Sets the path that will be assigned to any session tracking cookies created on behalf of the application represented
by the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/servlet/SessionCookieConfig.html#setSecure-boolean-">setSecure</a></span>(boolean&nbsp;secure)</code>
<div class="block">Marks or unmarks the session tracking cookies created on behalf of the application represented by the
<tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired as <i>secure</i>.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="setName-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setName</h4>
<pre>void&nbsp;setName(java.lang.String&nbsp;name)</pre>
<div class="block">Sets the name that will be assigned to any session tracking cookies created on behalf of the application represented
by the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired.
<p>
NOTE: Changing the name of session tracking cookies may break other tiers (for example, a load balancing frontend)
that assume the cookie name to be equal to the default <tt>JSESSIONID</tt>, and therefore should only be done
cautiously.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the cookie name to use</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalStateException</code> - if the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was
acquired has already been initialized</dd>
</dl>
</li>
</ul>
<a name="getName--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getName</h4>
<pre>java.lang.String&nbsp;getName()</pre>
<div class="block">Gets the name that will be assigned to any session tracking cookies created on behalf of the application represented
by the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired.
<p>
By default, <tt>JSESSIONID</tt> will be used as the cookie name.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the cookie name set via <a href="../../jakarta/servlet/SessionCookieConfig.html#setName-java.lang.String-"><code>setName(java.lang.String)</code></a>, or <tt>null</tt> if <a href="../../jakarta/servlet/SessionCookieConfig.html#setName-java.lang.String-"><code>setName(java.lang.String)</code></a> was never called</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../jakarta/servlet/http/Cookie.html#getName--"><code>Cookie.getName()</code></a></dd>
</dl>
</li>
</ul>
<a name="setDomain-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setDomain</h4>
<pre>void&nbsp;setDomain(java.lang.String&nbsp;domain)</pre>
<div class="block">Sets the domain name that will be assigned to any session tracking cookies created on behalf of the application
represented by the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>domain</code> - the cookie domain to use</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalStateException</code> - if the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was
acquired has already been initialized</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../jakarta/servlet/http/Cookie.html#setDomain-java.lang.String-"><code>Cookie.setDomain(String)</code></a></dd>
</dl>
</li>
</ul>
<a name="getDomain--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDomain</h4>
<pre>java.lang.String&nbsp;getDomain()</pre>
<div class="block">Gets the domain name that will be assigned to any session tracking cookies created on behalf of the application
represented by the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the cookie domain set via <a href="../../jakarta/servlet/SessionCookieConfig.html#setDomain-java.lang.String-"><code>setDomain(java.lang.String)</code></a>, or <tt>null</tt> if <a href="../../jakarta/servlet/SessionCookieConfig.html#setDomain-java.lang.String-"><code>setDomain(java.lang.String)</code></a> was never called</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../jakarta/servlet/http/Cookie.html#getDomain--"><code>Cookie.getDomain()</code></a></dd>
</dl>
</li>
</ul>
<a name="setPath-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPath</h4>
<pre>void&nbsp;setPath(java.lang.String&nbsp;path)</pre>
<div class="block">Sets the path that will be assigned to any session tracking cookies created on behalf of the application represented
by the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>path</code> - the cookie path to use</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalStateException</code> - if the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was
acquired has already been initialized</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../jakarta/servlet/http/Cookie.html#setPath-java.lang.String-"><code>Cookie.setPath(String)</code></a></dd>
</dl>
</li>
</ul>
<a name="getPath--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPath</h4>
<pre>java.lang.String&nbsp;getPath()</pre>
<div class="block">Gets the path that will be assigned to any session tracking cookies created on behalf of the application represented
by the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired.
<p>
By default, the context path of the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired
will be used.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the cookie path set via <a href="../../jakarta/servlet/SessionCookieConfig.html#setPath-java.lang.String-"><code>setPath(java.lang.String)</code></a>, or <tt>null</tt> if <a href="../../jakarta/servlet/SessionCookieConfig.html#setPath-java.lang.String-"><code>setPath(java.lang.String)</code></a> was never called</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../jakarta/servlet/http/Cookie.html#getPath--"><code>Cookie.getPath()</code></a></dd>
</dl>
</li>
</ul>
<a name="setComment-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setComment</h4>
<pre>@Deprecated
void&nbsp;setComment(java.lang.String&nbsp;comment)</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">This is no longer required with RFC 6265</span></div>
<div class="block">With the adoption of support for RFC 6265, this method should no longer be used.
<p>
If called, this method has no effect.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>comment</code> - ignore</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalStateException</code> - if the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was
acquired has already been initialized</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../jakarta/servlet/http/Cookie.html#setComment-java.lang.String-"><code>Cookie.setComment(String)</code></a>,
<a href="../../jakarta/servlet/http/Cookie.html#getVersion--"><code>Cookie.getVersion()</code></a></dd>
</dl>
</li>
</ul>
<a name="getComment--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getComment</h4>
<pre>@Deprecated
java.lang.String&nbsp;getComment()</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">This is no longer required with RFC 6265</span></div>
<div class="block">With the adoption of support for RFC 6265, this method should no longer be used.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Always <code>null</code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../jakarta/servlet/http/Cookie.html#getComment--"><code>Cookie.getComment()</code></a></dd>
</dl>
</li>
</ul>
<a name="setHttpOnly-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setHttpOnly</h4>
<pre>void&nbsp;setHttpOnly(boolean&nbsp;httpOnly)</pre>
<div class="block">Marks or unmarks the session tracking cookies created on behalf of the application represented by the
<tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired as <i>HttpOnly</i>.
<p>
A cookie is marked as <tt>HttpOnly</tt> by adding the <tt>HttpOnly</tt> attribute to it. <i>HttpOnly</i> cookies are
not supposed to be exposed to client-side scripting code, and may therefore help mitigate certain kinds of cross-site
scripting attacks.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>httpOnly</code> - true if the session tracking cookies created on behalf of the application represented by the
<tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired shall be marked as <i>HttpOnly</i>,
false otherwise</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalStateException</code> - if the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was
acquired has already been initialized</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../jakarta/servlet/http/Cookie.html#setHttpOnly-boolean-"><code>Cookie.setHttpOnly(boolean)</code></a></dd>
</dl>
</li>
</ul>
<a name="isHttpOnly--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isHttpOnly</h4>
<pre>boolean&nbsp;isHttpOnly()</pre>
<div class="block">Checks if the session tracking cookies created on behalf of the application represented by the
<tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired will be marked as <i>HttpOnly</i>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the session tracking cookies created on behalf of the application represented by the
<tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired will be marked as <i>HttpOnly</i>,
false otherwise</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../jakarta/servlet/http/Cookie.html#isHttpOnly--"><code>Cookie.isHttpOnly()</code></a></dd>
</dl>
</li>
</ul>
<a name="setSecure-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSecure</h4>
<pre>void&nbsp;setSecure(boolean&nbsp;secure)</pre>
<div class="block">Marks or unmarks the session tracking cookies created on behalf of the application represented by the
<tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired as <i>secure</i>.
<p>
One use case for marking a session tracking cookie as <tt>secure</tt>, even though the request that initiated the
session came over HTTP, is to support a topology where the web container is front-ended by an SSL offloading load
balancer. In this case, the traffic between the client and the load balancer will be over HTTPS, whereas the traffic
between the load balancer and the web container will be over HTTP.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>secure</code> - true if the session tracking cookies created on behalf of the application represented by the
<tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired shall be marked as <i>secure</i>
even if the request that initiated the corresponding session is using plain HTTP instead of HTTPS, and false if they
shall be marked as <i>secure</i> only if the request that initiated the corresponding session was also secure</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalStateException</code> - if the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was
acquired has already been initialized</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../jakarta/servlet/http/Cookie.html#setSecure-boolean-"><code>Cookie.setSecure(boolean)</code></a>,
<a href="../../jakarta/servlet/ServletRequest.html#isSecure--"><code>ServletRequest.isSecure()</code></a></dd>
</dl>
</li>
</ul>
<a name="isSecure--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSecure</h4>
<pre>boolean&nbsp;isSecure()</pre>
<div class="block">Checks if the session tracking cookies created on behalf of the application represented by the
<tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired will be marked as <i>secure</i>
even if the request that initiated the corresponding session is using plain HTTP instead of HTTPS.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the session tracking cookies created on behalf of the application represented by the
<tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired will be marked as <i>secure</i>
even if the request that initiated the corresponding session is using plain HTTP instead of HTTPS, and false if they
will be marked as <i>secure</i> only if the request that initiated the corresponding session was also secure</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../jakarta/servlet/http/Cookie.html#getSecure--"><code>Cookie.getSecure()</code></a>,
<a href="../../jakarta/servlet/ServletRequest.html#isSecure--"><code>ServletRequest.isSecure()</code></a></dd>
</dl>
</li>
</ul>
<a name="setMaxAge-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMaxAge</h4>
<pre>void&nbsp;setMaxAge(int&nbsp;maxAge)</pre>
<div class="block">Sets the lifetime (in seconds) for the session tracking cookies created on behalf of the application represented by
the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>maxAge</code> - the lifetime (in seconds) of the session tracking cookies created on behalf of the application
represented by the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalStateException</code> - if the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was
acquired has already been initialized</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../jakarta/servlet/http/Cookie.html#setMaxAge-int-"><code>Cookie.setMaxAge(int)</code></a></dd>
</dl>
</li>
</ul>
<a name="getMaxAge--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxAge</h4>
<pre>int&nbsp;getMaxAge()</pre>
<div class="block">Gets the lifetime (in seconds) of the session tracking cookies created on behalf of the application represented by
the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired.
<p>
By default, <tt>-1</tt> is returned.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the lifetime (in seconds) of the session tracking cookies created on behalf of the application represented by
the <tt>ServletContext</tt> from which this <tt>SessionCookieConfig</tt> was acquired, or <tt>-1</tt> (the default)</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../jakarta/servlet/http/Cookie.html#getMaxAge--"><code>Cookie.getMaxAge()</code></a></dd>
</dl>
</li>
</ul>
<a name="setAttribute-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAttribute</h4>
<pre>void&nbsp;setAttribute(java.lang.String&nbsp;name,
java.lang.String&nbsp;value)</pre>
<div class="block">Sets the value for the given session cookie attribute. When a value is set via this method, the value returned by the
attribute specific getter (if any) must be consistent with the value set via this method.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - Name of attribute to set, case insensitive</dd>
<dd><code>value</code> - Value of attribute</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalStateException</code> - if the associated ServletContext has already been initialised</dd>
<dd><code>java.lang.IllegalArgumentException</code> - If the attribute name is null or contains any characters not permitted for use in
Cookie names.</dd>
<dd><code>java.lang.NumberFormatException</code> - If the attribute is known to be numerical but the provided value cannot be parsed to a
number.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>Servlet 6.0</dd>
</dl>
</li>
</ul>
<a name="getAttribute-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAttribute</h4>
<pre>java.lang.String&nbsp;getAttribute(java.lang.String&nbsp;name)</pre>
<div class="block">Obtain the value for a given session cookie attribute. Values returned from this method must be consistent with the
values set and returned by the attribute specific getters and setters in this class.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - Name of attribute to return, case insensitive</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Value of specified attribute</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>Servlet 6.0</dd>
</dl>
</li>
</ul>
<a name="getAttributes--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getAttributes</h4>
<pre>java.util.Map&lt;java.lang.String,java.lang.String&gt;&nbsp;getAttributes()</pre>
<div class="block">Obtain the Map (keys are case insensitive) of all attributes and values, including those set via the attribute
specific setters, (excluding version) for this <tt>SessionCookieConfig</tt>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A read-only Map of attributes to values, excluding version.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>Servlet 6.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>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<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><a href="../../jakarta/servlet/ServletSecurityElement.html" title="class in jakarta.servlet"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../jakarta/servlet/SessionTrackingMode.html" title="enum in jakarta.servlet"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?jakarta/servlet/SessionCookieConfig.html" target="_top">Frames</a></li>
<li><a href="SessionCookieConfig.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>