Fields Summary |
---|
public static final String | SESSION_COOKIE_DEFAULT_COMMENTThe default value for the session tracking cookie's comment. |
public static final String | DYNAMIC_SECUREThe value that allows the JSESSIONID cookie's secure attribute to
be configured based on the connection i.e. secure if HTTPS. |
private String | _nameThe name of the cookie used for session tracking.
Default value is JSESSIONID |
private String | _pathThe pathname that is set when the cookie is created.
The default value is the context path at which the web application
is installed. The browser will send the cookie if the pathname for the
request contains this pathname. If set to / (slash), the browser will
send the cookie to all URLs. |
private int | _maxAgeThe expiration time in seconds after which the browser expires
the cookie.
The default value is -1 (never expire). |
private String | _domainThe domain for which the cookie is valid. |
private String | _commentThe comment that identifies the session tracking cookie in the
browser's cookie file. Applications may choose to provide a more
specific name for this cookie. |
private String | _secureWhen set to "dynamic", the cookie is marked as secure only if the
connection on which the request was received is secure. To override this
behaviour, the value of this property can be set to "true" or "false".
If set to "true", user agents will use secure means to contact the
origin server when sending back the cookie regardless of whether the
connection on which the request was received is secure. If set to
"false", user agents do not have to use secure means to contact the
origin server when sending back the cookie regardless of whether the
connection on which the request was received is secure. |
Methods Summary |
---|
public java.lang.String | getComment()Return the URLEncoded form of the comment that identifies the session
cookie.
return _comment;
|
public java.lang.String | getDomain()Return the domain for which the cookie is valid.
return _domain;
|
public int | getMaxAge()Return the expiration time for the session cookie.
return _maxAge;
|
public java.lang.String | getName()Return the name of the session tracking cookie.
return _name;
|
public java.lang.String | getPath()Return the path that is set when the session tracking cookie is
created.
return _path;
|
public java.lang.String | getSecure()Return whether the cookie is to be marked Secure or not.
return _secure;
|
public void | setComment(java.lang.String comment)Set the comment that identifies the session cookie.
_comment = comment;
if (comment != null)
_comment = URLEncoder.encode(comment);
|
public void | setDomain(java.lang.String domain)Set the domain for which the cookie is valid.
_domain = domain;
|
public void | setMaxAge(int maxAge)Set the expiration time for the session cookie.
_maxAge = maxAge;
|
public void | setName(java.lang.String name)Set the name of the session tracking cookie (currently not supported).
_name = name;
|
public void | setPath(java.lang.String path)Set the path to use when creating the session tracking cookie.
_path = path;
|
public void | setSecure(java.lang.String secure)Set whether the cookie is marked Secure or not.
if ((secure == null) || (!secure.equalsIgnoreCase("true") &&
!secure.equalsIgnoreCase("false") &&
!secure.equalsIgnoreCase(SessionCookieConfig.DYNAMIC_SECURE))) {
throw new IllegalArgumentException();
}
_secure = secure;
|
public java.lang.String | toString()Return a String representation of this object.
StringBuffer sb = new StringBuffer("SessionCookieConfig[");
sb.append("name=");
sb.append(_name);
if (_path != null) {
sb.append(", path=");
sb.append(_path);
}
sb.append(", maxAge=");
sb.append(_maxAge);
if (_domain != null) {
sb.append(", domain=");
sb.append(_domain);
}
if (_comment != null) {
sb.append(", comment=");
sb.append(_comment);
}
sb.append("]");
return (sb.toString());
|